diff options
author | bpodgursky <bpodgursky@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-19 07:07:46 +0000 |
---|---|---|
committer | bpodgursky <bpodgursky@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-01-19 07:07:46 +0000 |
commit | a4cc54d436a15a92fff3c482d5900f942f4fa60a (patch) | |
tree | 64573adf3584206d884e50f23296950ed8c20fea | |
parent | ae5dea03a10b1e3c587c33442b3d6142c2e6b961 (diff) | |
download | ATCD-a4cc54d436a15a92fff3c482d5900f942f4fa60a.tar.gz |
-rw-r--r-- | SA_POP/Planner.cpp | 8 | ||||
-rw-r--r-- | SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Planner.cpp | 21 | ||||
-rw-r--r-- | SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp | 2 | ||||
-rwxr-xr-x | SA_POP/utils/SANetGenerator/Rand_Params.py | 2 |
4 files changed, 20 insertions, 13 deletions
diff --git a/SA_POP/Planner.cpp b/SA_POP/Planner.cpp index c00408cde67..77096b87fcb 100644 --- a/SA_POP/Planner.cpp +++ b/SA_POP/Planner.cpp @@ -586,10 +586,6 @@ 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 << ") " ; @@ -597,10 +593,6 @@ 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 997b8f8e544..591aa325766 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 @@ -262,9 +262,9 @@ bool Exp_EU_Planner::plan (size_t sa_max_steps, SA_POP::Goal goal) } //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; - } + //if(goal_iter->second){ + // return false; + //} } // Set planning strategy goals and satisfy open conditions. @@ -319,6 +319,21 @@ void Exp_EU_Planner::track_stats (SA_POP::Plan plan) // Get plan EU. SA_POP::Utility plan_eu = this->calc_plan_eu (plan); + GoalMap goals = this->sanet_->get_goals(); + + double max_eu = 0; + for(GoalMap::iterator it = goals.begin(); it != goals.end(); it++){ + max_eu+=it->second; + } + + if(max_eu < plan_eu){ + std::ostringstream invalid_plan_str; + invalid_plan_str << "Invalid plan EU, returning"; + SA_POP_DEBUG_STR(SA_POP_DEBUG_TEMP, invalid_plan_str.str ()); + + return; + } + //*****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***** // Output plan EUs //std::ostringstream plan_eu_str; diff --git a/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp b/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp index 5ab2ac857db..e0f542d58e2 100644 --- a/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp +++ b/SA_POP/experiments/EU_Performance/SAPOP_Exp_EU.cpp @@ -14,7 +14,7 @@ //============================================================================= //#define _CRTDBG_MAP_ALLOC -//#include <stdlib.h> +#include <stdlib.h> //#include <crtdbg.h> #include <iostream> diff --git a/SA_POP/utils/SANetGenerator/Rand_Params.py b/SA_POP/utils/SANetGenerator/Rand_Params.py index 23a24489a4a..668b94c2154 100755 --- a/SA_POP/utils/SANetGenerator/Rand_Params.py +++ b/SA_POP/utils/SANetGenerator/Rand_Params.py @@ -42,7 +42,7 @@ def flatGen(SANet, tasks, conds): #dire = rand.uniform(0,2) - 1 #if dire >= 0: - weight = rand.uniform(.8,1) + weight = rand.uniform(.8, 1) #else: # weight = rand.uniform(-.8,-1) #a tuple for efficient look up |