diff options
author | bpodgursky <bpodgursky@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-19 02:43:50 +0000 |
---|---|---|
committer | bpodgursky <bpodgursky@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-19 02:43:50 +0000 |
commit | ae5dea03a10b1e3c587c33442b3d6142c2e6b961 (patch) | |
tree | cb445930de87da229222dd4732ed84de32f79d0f | |
parent | 3d8cee9278a8b06b2023959fd16bbf90a57c78c4 (diff) | |
download | ATCD-ae5dea03a10b1e3c587c33442b3d6142c2e6b961.tar.gz |
-rw-r--r-- | SA_POP/Planner.cpp | 8 | ||||
-rw-r--r-- | SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp | 20 | ||||
-rw-r--r-- | SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp | 8 |
3 files changed, 28 insertions, 8 deletions
diff --git a/SA_POP/Planner.cpp b/SA_POP/Planner.cpp index 77096b87fcb..c00408cde67 100644 --- a/SA_POP/Planner.cpp +++ b/SA_POP/Planner.cpp @@ -586,6 +586,10 @@ Utility Planner::calc_plan_eu(Plan plan) // Expected utility of the goal condition is its probability times utility. eu = prob * util; + if(eu > 10){ + bool b = true; + } + eu_total += eu; // eu_str << prob << ", " << eu << ") " ; @@ -593,6 +597,10 @@ Utility Planner::calc_plan_eu(Plan plan) // SA_POP_DEBUG_STR(SA_POP_DEBUG_TEMP, eu_str.str ()); + if(eu_total > 10){ + bool b = true; + } + return eu_total; }; diff --git a/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp b/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp index d06575988b2..997b8f8e544 100644 --- a/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp +++ b/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp @@ -196,7 +196,6 @@ SA_POP::Exp_EU_Run_Results Exp_EU_Planner::exp_run (std::string log_trials_filen // For invalid trial, decrement trial counter. trial_num--; } - } // Log run statistics to output file. @@ -235,9 +234,14 @@ bool Exp_EU_Planner::plan (size_t sa_max_steps, SA_POP::Goal goal) // Check that goal conditions meet probability criteria. // Skip planning and return false if any goal condition does not. for (SA_POP::GoalMap::iterator goal_iter = goal.goal_conds.begin (); goal_iter != goal.goal_conds.end (); goal_iter++) { - if (goal_iter->second >= 0) { - if (this->sanet_->get_cond_future_val(goal_iter->first, true) > 1.0 || this->sanet_->get_cond_future_val(goal_iter->first, true) < SA_POP::Default::GOAL_PROB_THRESH) { - std::ostringstream invalid_goal_str; + if (goal_iter->second >= 0) + { + if (this->sanet_->get_cond_future_val(goal_iter->first, true) > 1.0 || this->sanet_->get_cond_future_val(goal_iter->first, true) < SA_POP::Default::GOAL_PROB_THRESH) + { + + + + std::ostringstream invalid_goal_str; invalid_goal_str << "Goal condition (" << this->sanet_->get_cond_name (goal_iter->first) << ") "; invalid_goal_str << "with probability, " << this->sanet_->get_cond_future_val(goal_iter->first, true) << ", "; invalid_goal_str << "does not meet goal probability criteria. Skipping planning."; @@ -256,6 +260,11 @@ bool Exp_EU_Planner::plan (size_t sa_max_steps, SA_POP::Goal goal) return false; } } + + //Very Temp--this is only for debugging, limit goal utility to 10 for now + if(this->sanet_->get_cond_future_val(goal_iter->first, true) > 10){ + return false; + } } // Set planning strategy goals and satisfy open conditions. @@ -357,6 +366,9 @@ void Exp_EU_Planner::track_stats (SA_POP::Plan plan) // Ignore plan. return; } + + std::cout<<"EU of plan: "<<plan_eu<<" init plan EU: "<<this->trial_init_plan_eu<<std::endl; + //*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP*****TEMP***** diff --git a/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp b/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp index c365fa7072d..5ab2ac857db 100644 --- a/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp +++ b/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp @@ -13,9 +13,9 @@ */ //============================================================================= -#define _CRTDBG_MAP_ALLOC -#include <stdlib.h> -#include <crtdbg.h> +//#define _CRTDBG_MAP_ALLOC +//#include <stdlib.h> +//#include <crtdbg.h> #include <iostream> #include <fstream> @@ -577,7 +577,7 @@ int main (int argc, char* argv[]) // UserInterface::Question end_ques ("Enter any character to end program:"); // user_input.ask (end_ques); - _CrtDumpMemoryLeaks(); + //_CrtDumpMemoryLeaks(); return 0; }; |