summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmack <dmack@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-07-01 22:14:23 +0000
committerdmack <dmack@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-07-01 22:14:23 +0000
commit557ea46dc33edd880bd523d3aa920389d179aa9b (patch)
treede833ce1583275dc4490267a43eeeacb168fe910
parent8e64c22757418f9e5a402004196c1e68c1aa06e3 (diff)
downloadATCD-557ea46dc33edd880bd523d3aa920389d179aa9b.tar.gz
Wed Jul 1 22:13:25 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
-rw-r--r--ChangeLog11
-rw-r--r--SA_PlanStrategy.cpp6
-rw-r--r--SA_WorkingPlan.cpp27
3 files changed, 34 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index b4932e9a125..0be39f7c072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+Wed Jul 1 22:13:25 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
+
+ * SA_PlanStrategy.cpp:
+ * SA_WorkingPlan.cpp:
+ Updated to allow for goal_task_inst to be part of threats.
+ Small aesthetic changes
+
Tue Jun 30 20:10:07 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
* SA_PlanStrategy.cpp:
* SA_SchedStrategy.cpp:
- Modified undo for removing open conds to match the breadth first search.
- Indented some of ankits code for readability.
+ Modified undo for removing open conds to match the breadth first search.
+ Indented some of ankits code for readability.
Mon Jun 29 21:52:33 UTC 2009 Ben Podgursky <bpodgursky@gmail.com>
diff --git a/SA_PlanStrategy.cpp b/SA_PlanStrategy.cpp
index 899b9ba47d6..ea55dcdacc8 100644
--- a/SA_PlanStrategy.cpp
+++ b/SA_PlanStrategy.cpp
@@ -245,6 +245,12 @@ bool SA_PlanStrategy::satisfy_everything(){
this->cur_task_inst_ = assoc_impl_cmd->get_task_inst ();
+ //TEMP***
+ //if(this->cur_task_inst_ == 10)
+ //{
+ // throw "At the 10th task instance";
+ //}
+
while (this->planner_->try_next (assoc_impl_cmd->get_id ()))
{
diff --git a/SA_WorkingPlan.cpp b/SA_WorkingPlan.cpp
index 045655b30ef..5bb69a959aa 100644
--- a/SA_WorkingPlan.cpp
+++ b/SA_WorkingPlan.cpp
@@ -652,12 +652,13 @@ void SA_WorkingPlan::generate_all_threats(void)
debug_text << "SA_WorkingPlan::generate_all_threats: All Causal Threats: " << std::endl;
-
+ //Iterate through task instances
for(InstToTaskMap::iterator iterator = this->task_insts_.begin(); iterator != this->task_insts_.end(); iterator++){
TaskInstID threat_possibility = iterator->first;
TaskID threat_possibility_taskid = iterator->second;
CondSet set = this->planner_->get_effects(threat_possibility_taskid);
-
+
+ //Iterate through the effects of each task instance
for(CondSet::iterator arr = set.begin(); arr != set.end(); arr++){
Condition condition = (*arr);
@@ -667,7 +668,7 @@ void SA_WorkingPlan::generate_all_threats(void)
CondToCLinksMap::iterator
> ret = this->causal_links_.equal_range(condition);
-
+ //Iterates through causal links
for(CondToCLinksMap::iterator nit = ret.first; nit != ret.second; nit++){
CausalLink causal_threatened = (*nit).second;
@@ -679,18 +680,28 @@ void SA_WorkingPlan::generate_all_threats(void)
if((threat_effect > 0 && causal_effect < 0 )|| (threat_effect < 0 && causal_effect > 0)){
- if(causal_threatened.first != threat_possibility && causal_threatened.second != threat_possibility
- && causal_threatened.second != -1)
+ if(causal_threatened.first != threat_possibility && causal_threatened.second != threat_possibility)
{
- TaskID threatened_task1 = this->task_insts_.find(causal_threatened.first)->second;
- TaskID threatened_task2 = this->task_insts_.find(causal_threatened.second)->second;
+
CLThreat new_threat;
new_threat.clink = causal_threatened;
new_threat.threat = threat_possibility;
threat_set.insert(new_threat);
- debug_text <<" Causal link from Task ("<< threatened_task1 <<") Inst ("<< causal_threatened.first <<") to Task ("<< threatened_task2 <<") Inst ("<< causal_threatened.second <<") using condition "<<causal_threatened.cond.id<<" threatened by Task ("<< threat_possibility_taskid <<") Inst ("<<threat_possibility<<")" << std::endl;
+ TaskID threatened_task1 = this->task_insts_.find(causal_threatened.first)->second;
+ if(causal_threatened.second != SA_POP::GOAL_TASK_INST_ID)
+ {
+ TaskID threatened_task2 = this->task_insts_.find(causal_threatened.second)->second;
+ debug_text <<" Causal link from Task ("<< threatened_task1 <<") Inst ("<< causal_threatened.first <<") to Task ("<< threatened_task2 <<") Inst ("<< causal_threatened.second <<") using condition "<<causal_threatened.cond.id<<" threatened by Task ("<< threat_possibility_taskid <<") Inst ("<<threat_possibility<<")" << std::endl;
+
+ }
+ else
+ {
+ debug_text <<" Causal link from Task ("<< threatened_task1 <<") Inst ("<< causal_threatened.first <<") to Task ( GOAL_TASK )Inst (GOAL_TASK_INST) using condition "<<causal_threatened.cond.id<<" threatened by Task ("<< threat_possibility_taskid <<") Inst ("<<threat_possibility<<")" << std::endl;
+ }
+
+
}