diff options
author | jkinnebrew <jkinnebrew@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-12-30 22:03:05 +0000 |
---|---|---|
committer | jkinnebrew <jkinnebrew@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-12-30 22:03:05 +0000 |
commit | f1a5bf2de857ceb2f5b3375068cd82e85316e156 (patch) | |
tree | 2601268abdd2c7348b4cc0fae8608aba6ef3d12e | |
parent | aa28b017fc6276d6b41ddbdd7e09d195761dedf7 (diff) | |
download | ATCD-f1a5bf2de857ceb2f5b3375068cd82e85316e156.tar.gz |
Wed Dec 30 22:01:23 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu>
-rw-r--r-- | SA_POP/ChangeLog | 19 | ||||
-rw-r--r-- | SA_POP/Planner.cpp | 2 | ||||
-rw-r--r-- | SA_POP/SANet/SANetFileIn.cpp | 4 | ||||
-rw-r--r-- | SA_POP/SANet/SANet_Types.h | 12 | ||||
-rw-r--r-- | SA_POP/SA_POP_Types.h | 49 | ||||
-rw-r--r-- | SA_POP/SA_PlanStrategy.cpp | 4 | ||||
-rw-r--r-- | SA_POP/Standalone/SA_POP_Demo.cpp | 4 | ||||
-rw-r--r-- | SA_POP/TaskMapFileIn.cpp | 2 |
8 files changed, 67 insertions, 29 deletions
diff --git a/SA_POP/ChangeLog b/SA_POP/ChangeLog index 97d4655fee6..d733422d30e 100644 --- a/SA_POP/ChangeLog +++ b/SA_POP/ChangeLog @@ -1,3 +1,15 @@ +Wed Dec 30 22:01:23 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu> + + * Planner.cpp: + * SA_POP_Types.h: + * SA_PlanStrategy.cpp: + * TaskMapFileIn.cpp: + * SANet/SANetFileIn.cpp: + * SANet/SANet_Types.h: + * Standalone/SA_POP_Demo.cpp: + + Updated SA-POP default value handling. + Tue Dec 29 22:28:23 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu> * UserInput: @@ -33,7 +45,7 @@ Tue Dec 29 22:28:23 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.ed Added SANet cloning (deep copy by copy constructor). Also cleaned up some more of the SANet code. - + Fri Dec 18 20:28:36 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu> @@ -54,6 +66,7 @@ Fri Dec 18 20:28:36 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.ed Removed SANet cruft (including non-functional methods called from the planner in SA-POP). Also cleaned up some of the SANet & SANode commenting and constructors. + Fri Dec 18 01:00:33 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu> * SA_Builder.h: @@ -88,6 +101,7 @@ Fri Dec 18 01:00:33 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.ed Removed these files (old EU experiment skeleton). + Fri Dec 11 23:54:51 UTC 2009 Ben Podgursky <bpodgursky@gmail.com> * Planner.cpp: @@ -141,6 +155,7 @@ Fri Dec 4 18:16:57 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu> These files were modified to take the new active and disabled flags for computing expected utilities of plans. + Tue Nov 10 21:55:22 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu> * utils/SANetGenerator/Net_Complete.py: @@ -157,6 +172,7 @@ Tue Nov 10 21:54:59 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu> Updated to fix a bug with knowing when to stop. + Mon Nov 9 00:49:19 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * SA_POP_Types.h: @@ -170,6 +186,7 @@ Mon Nov 9 00:49:19 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> Portablility fixes. + Wed Nov 4 22:47:08 UTC 2009 John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu> diff --git a/SA_POP/Planner.cpp b/SA_POP/Planner.cpp index 89c3c1709a3..9100a880143 100644 --- a/SA_POP/Planner.cpp +++ b/SA_POP/Planner.cpp @@ -31,7 +31,7 @@ using namespace SA_POP; // Constructor. Planner::Planner (void) -: cond_prob_thresh_ (0.9), +: cond_prob_thresh_ (SA_POP::Default::COND_PROB_THRESH), has_objs_ (false), sanet_ (0), plan_strat_ (0), diff --git a/SA_POP/SANet/SANetFileIn.cpp b/SA_POP/SANet/SANetFileIn.cpp index 3cb6b0f347a..b3d71aeafee 100644 --- a/SA_POP/SANet/SANetFileIn.cpp +++ b/SA_POP/SANet/SANetFileIn.cpp @@ -47,7 +47,7 @@ Network *SANetFileIn::build_net (std::string filename) return 0; // Set path to XML schemas (XSD files). - XML_Helper::_path_resolver.add_path (SA_POP::ROOT_PATH_STR.c_str (), SA_POP::XSD_REL_PATH_STR.c_str ()); + XML_Helper::_path_resolver.add_path (SA_POP::Default::ROOT_PATH_STR.c_str (), SA_POP::Default::XSD_REL_PATH_STR.c_str ()); // Parse file with Xerces. XERCES_CPP_NAMESPACE::DOMDocument *dom = @@ -162,7 +162,7 @@ void SANetFileIn::build_net (std::string filename, SA_POP::Builder *builder) return; // Set path to XML schemas (XSD files). - XML_Helper::_path_resolver.add_path (SA_POP::ROOT_PATH_STR.c_str (), SA_POP::XSD_REL_PATH_STR.c_str ()); + XML_Helper::_path_resolver.add_path (SA_POP::Default::ROOT_PATH_STR.c_str (), SA_POP::Default::XSD_REL_PATH_STR.c_str ()); // Parse file with Xerces. XERCES_CPP_NAMESPACE::DOMDocument *dom = diff --git a/SA_POP/SANet/SANet_Types.h b/SA_POP/SANet/SANet_Types.h index 5b4483b516f..8bd240e664d 100644 --- a/SA_POP/SANet/SANet_Types.h +++ b/SA_POP/SANet/SANet_Types.h @@ -192,13 +192,13 @@ namespace SANet { #if defined (SANET_STANDALONE) namespace SA_POP { + namespace Default { + /// Environment variable for root path. + const std::string ROOT_PATH_STR = "SAPOP_ROOT"; - /// Environment variable for root path. - const std::string ROOT_PATH_STR = "SAPOP_ROOT"; - - /// Relative path (from root path) to SA-POP XML schemas. - const std::string XSD_REL_PATH_STR = "/docs/schema/"; - + /// Relative path (from root path) to SA-POP XML schemas. + const std::string XSD_REL_PATH_STR = "/docs/schema/"; + }; /* SA_POP::Default namespace */ }; /* SA_POP namespace */ namespace SANet { diff --git a/SA_POP/SA_POP_Types.h b/SA_POP/SA_POP_Types.h index ba17bf3feea..16bd73f1cdf 100644 --- a/SA_POP/SA_POP_Types.h +++ b/SA_POP/SA_POP_Types.h @@ -59,20 +59,6 @@ if (x <= SA_POP_DEBUG_LEVEL) \ namespace SA_POP { -//*****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***** - /// MAXIMUM number of task instances to allow in plan before planning failure. - const int MAX_TASK_INSTS = 12; -//*****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***** - - - - - /// Environment variable for root path. - const std::string ROOT_PATH_STR = "SAPOP_ROOT"; - - /// Relative path (from root path) to SA-POP XML schemas. - const std::string XSD_REL_PATH_STR = "/docs/schema/"; - /// Type of a node id (tasks and conditions). /// (must be > 0 and unique across all tasks *and* conditions). typedef int NodeID; @@ -812,4 +798,39 @@ namespace SA_POP { }; /* SA_POP namespace */ + +// Default values for use in SA-POP. +namespace SA_POP { + namespace Default { + /// Threshold (>=) for probability of a condition to be considered satisfied. + const ::SA_POP::Probability COND_PROB_THRESH = 0.9; + + /// Environment variable for root path. + const std::string ROOT_PATH_STR = "SAPOP_ROOT"; + + /// Relative path (from root path) to SA-POP XML schemas. + const std::string XSD_REL_PATH_STR = "/docs/schema/"; + + /// Maximum number of steps to run spreading activation. + /// (NOTE: Corresponds to consideration of the probabilistic effects + /// of action sequences up to a length of half this value.) + const size_t SA_MAX_STEPS = 1000; + +//*****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***** + /// Special value indicating UNLIMITED number of task instances allowed in plan. + /// (USE: Set MAX_TASK_INSTS equal to this value to allow unlimited task instances in planning.) + /// (NOTE: Value must be less than 0, so it does not conflict with other possible values + /// of MAX_TASK_INSTS.) + const int UNLIMITED_TASK_INSTS = -1; + + /// MAXIMUM number of task instances to allow in plan (before planning failure). + /// (WARNING: Use of this value is currently hard-coded into SA-POP + /// with no way to externally override it.) + const int MAX_TASK_INSTS = UNLIMITED_TASK_INSTS; +//*****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***** + + }; /* SA_POP::Default namespace */ +}; /* SA_POP namespace */ + + #endif /* SA_POP_TYPES_H_ */ diff --git a/SA_POP/SA_PlanStrategy.cpp b/SA_POP/SA_PlanStrategy.cpp index 65334b6679e..10c1b76fe5d 100644 --- a/SA_POP/SA_PlanStrategy.cpp +++ b/SA_POP/SA_PlanStrategy.cpp @@ -146,8 +146,8 @@ bool SA_PlanStrategy::satisfy_open_conds (void) if (this->open_conds_.empty ()) return this->planner_->full_sched(); - if( MAX_TASK_INSTS == -1 || - !(this->planner_->get_working_plan()->get_all_insts().size() > MAX_TASK_INSTS)){ + if( SA_POP::Default::MAX_TASK_INSTS == SA_POP::Default::UNLIMITED_TASK_INSTS || + this->planner_->get_working_plan()->get_all_insts().size() <= SA_POP::Default::MAX_TASK_INSTS ){ // Increment step counter. this->cur_step_++; diff --git a/SA_POP/Standalone/SA_POP_Demo.cpp b/SA_POP/Standalone/SA_POP_Demo.cpp index 64c916bef4f..f80dc34699b 100644 --- a/SA_POP/Standalone/SA_POP_Demo.cpp +++ b/SA_POP/Standalone/SA_POP_Demo.cpp @@ -21,7 +21,7 @@ #include "InputCL.h" -// SA-POP DEFAULTS. +// Additional SA-POP DEFAULT values for use in standalone demo. namespace SA_POP { namespace Default { const SA_POP::CondID CondIDMin = 1; @@ -31,7 +31,7 @@ namespace SA_POP { }; /* SA_POP::Default namespace */ }; /* SA_POP namespace */ -// SPREADING ACTIVATION DEFAULTS. +// Additional SANet DEFAULT values for us in standalone demo. namespace SANet { namespace Default { const size_t SA_MAX_STEPS = 1000; diff --git a/SA_POP/TaskMapFileIn.cpp b/SA_POP/TaskMapFileIn.cpp index 85879795aee..07508849e87 100644 --- a/SA_POP/TaskMapFileIn.cpp +++ b/SA_POP/TaskMapFileIn.cpp @@ -41,7 +41,7 @@ void TaskMapFileIn::build_task_map (std::string filename, Builder *builder) throw "SA_POP::TaskMapFileIn::build_task_map (): Could not initialize XML_Helper"; // Set path to XML schemas (XSD files). - XML_Helper::_path_resolver.add_path (SA_POP::ROOT_PATH_STR.c_str (), SA_POP::XSD_REL_PATH_STR.c_str ()); + XML_Helper::_path_resolver.add_path (SA_POP::Default::ROOT_PATH_STR.c_str (), SA_POP::Default::XSD_REL_PATH_STR.c_str ()); // Parse file with Xerces. XERCES_CPP_NAMESPACE::DOMDocument *dom = |