From d3b0ef4e49a1e8877a07b4ab4a1f3bd1ee96327e Mon Sep 17 00:00:00 2001 From: dmack Date: Wed, 8 Jul 2009 01:16:08 +0000 Subject: Wed Jul 8 01:13:05 UTC 2009 Daniel L.C. Mack --- ChangeLog | 23 +++++++++++------- SA_POP_Types.h | 2 +- SA_WorkingPlan.cpp | 69 ++++++++---------------------------------------------- 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 + + * 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 * 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 * SA_PlanStrategy.cpp: * SA_WorkingPlan.h: * SA_WorkingPlan.cpp: - - + + Mon Jul 6 20:27:43 UTC 2009 Daniel L.C. Mack 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 :"<first<<"("<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 "< 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); + } } -- cgit v1.2.1