summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmack <dmack@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-07-08 01:16:08 +0000
committerdmack <dmack@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-07-08 01:16:08 +0000
commitd3b0ef4e49a1e8877a07b4ab4a1f3bd1ee96327e (patch)
tree78ed043e94f57b582b3f937dc553daeb37481e52
parent9694c888941541473dde863737d8e603a6c04870 (diff)
downloadATCD-d3b0ef4e49a1e8877a07b4ab4a1f3bd1ee96327e.tar.gz
Wed Jul 8 01:13:05 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
-rw-r--r--ChangeLog23
-rw-r--r--SA_POP_Types.h2
-rw-r--r--SA_WorkingPlan.cpp69
3 files changed, 26 insertions, 68 deletions
diff --git a/ChangeLog b/ChangeLog
index 0af2e0dec09..c67c3957356 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,19 @@
+Wed Jul 8 01:13:05 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
+
+ * SA_POP_Types.h:
+ * SA_WorkingPlan.cpp:
+
+ Fixed the comparison operator of less than to work correctly.
+
Tue Jul 7 23:10:22 UTC 2009 Ben Podgursky <bpodgursky@gmail.com>
* SA_PlanCommands.h:
- * SA_PlanHeuristics.cpp:
-
- Changed the order in which tasks are chosen to satisfy open conditions.
- Working on getting it to choose the correct tasks.
-
- * PlanCommands.h:
+ * SA_PlanHeuristics.cpp:
+
+ Changed the order in which tasks are chosen to satisfy open conditions.
+ Working on getting it to choose the correct tasks.
+
+ * PlanCommands.h:
* PlanHeuristics.h:
* Planner.h:
* SA_POP_Types.h:
@@ -15,8 +22,8 @@ Tue Jul 7 23:10:22 UTC 2009 Ben Podgursky <bpodgursky@gmail.com>
* SA_PlanStrategy.cpp:
* SA_WorkingPlan.h:
* SA_WorkingPlan.cpp:
-
-
+
+
Mon Jul 6 20:27:43 UTC 2009 Daniel L.C. Mack <daniel.l.mack@vanderbilt.edu>
diff --git a/SA_POP_Types.h b/SA_POP_Types.h
index d740055dc18..57261df0415 100644
--- a/SA_POP_Types.h
+++ b/SA_POP_Types.h
@@ -272,7 +272,7 @@ namespace SA_POP {
{
if (this->first == s.first) {
if (this->second == s.second)
- return this->cond < cond;
+ return this->cond < s.cond;
return this->second < s.second;
}
return this->first < s.first;
diff --git a/SA_WorkingPlan.cpp b/SA_WorkingPlan.cpp
index 4f4357a55cf..88474656685 100644
--- a/SA_WorkingPlan.cpp
+++ b/SA_WorkingPlan.cpp
@@ -576,65 +576,7 @@ void SA_WorkingPlan::generate_all_threats(void)
}
SA_POP_DEBUG_STR (SA_POP_DEBUG_NORMAL, debug_text.str ());
-/*
-
- for(InstToImplMap::iterator iterator = this->task_impls_.begin(); iterator != this->task_impls_.end(); iterator++){
- TaskInstID threat_possibility = (*iterator).first;
- TaskID threat_possibility_taskid = this->task_insts_.find(threat_possibility)->second;
-
- file_op<<" Task :"<<iterator->first<<"("<<threat_possibility_taskid<<")"<<std::endl;
- }
-
-
- for(InstToImplMap::iterator iterator = this->task_impls_.begin(); iterator != this->task_impls_.end(); iterator++){
-
- TaskInstID threat_possibility = iterator->first;
- TaskID threat_possibility_taskid = this->task_insts_.find(threat_possibility)->second;
- CondSet set = this->planner_->get_effects(threat_possibility_taskid);
- for(CondSet::iterator arr = set.begin(); arr != set.end(); arr++){
-
- Condition condition = (*arr);
-
- std::pair<
- CondToCLinksMap::iterator,
- CondToCLinksMap::iterator
- > ret = this->causal_links_.equal_range(condition);
-
-
- for(CondToCLinksMap::iterator nit = ret.first; nit != ret.second; nit++){
-
- CausalLink causal_threatened = (*nit).second;
- TaskID threatened_task = this->task_insts_.find(causal_threatened.first)->second;
-
- SANet::LinkWeight threat_effect = this->planner_->get_link(threat_possibility_taskid, condition.id);
- SANet::LinkWeight causal_effect = this->planner_->get_link(threatened_task, causal_threatened.cond.id);
-
-
- if((threat_effect > 0 && causal_effect < 0 )|| (threat_effect < 0 && causal_effect > 0)){
-
- 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);
-
- file_op<<" New threat: causal link from "<<causal_threatened.first<<" ("<<threatened_task1<<") to "<<causal_threatened.second<<" ("<<threatened_task2<<") using condition "<<causal_threatened.cond.id<<" threatened by "<<threat_possibility<<" ("<<threat_possibility_taskid<<")\n";
-
- }
- }
- }
- }
- }
-
- file_op.close();
-
-
-*/
debug_text.clear();
@@ -687,7 +629,12 @@ void SA_WorkingPlan::generate_all_threats(void)
CLThreat new_threat;
new_threat.clink = causal_threatened;
new_threat.threat = threat_possibility;
- threat_set.insert(new_threat);
+
+
+
+ std::pair<CLThreatSet::iterator, bool> asdf = threat_set.insert(new_threat);
+
+
TaskID threatened_task1 = this->task_insts_.find(causal_threatened.first)->second;
if(causal_threatened.second != SA_POP::GOAL_TASK_INST_ID)
@@ -851,6 +798,7 @@ void SA_WorkingPlan::execute (SA_AddTaskCmd *cmd)
Condition cond = cmd->cond_;
TaskInstID task_inst;
+ //bool hadInsts = false;
// If trying a new task (i.e., not still trying task instances for same task), get existing task instances for that task from working plan.
if(cmd->last_task_ != task)
@@ -858,7 +806,10 @@ void SA_WorkingPlan::execute (SA_AddTaskCmd *cmd)
// Get existing task instances for current task.
for(InstToTaskMap::iterator iter = this->task_insts_.begin(); iter!=this->task_insts_.end();iter++)
if(iter->second==cmd->tasks_.front())
+ {
+ //hadInsts = true;
cmd->used_task_insts_.insert(iter->first);
+ }
}