summaryrefslogtreecommitdiff
path: root/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp')
-rw-r--r--SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp b/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp
new file mode 100644
index 00000000000..70adb1b7377
--- /dev/null
+++ b/SA_POP/experiments/EU_Performance/Exp_Core/Exp_EU_Builder.cpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+// $Id$
+
+//=============================================================================
+/**
+ * @file Exp_EU_Builder.cpp
+ *
+ * This file contains the implementation of the Exp_EU_Builder concrete class,
+ * which implements a Builder creating SA_Planner and associated
+ * objects for planning with spreading activation networks and scheduling
+ * with the "roadblock" scheduler (Exp_EU_SchedStrategy).
+ *
+ * @author John S. Kinnebrew <john.s.kinnebrew@vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#include "SA_POP_Types.h"
+
+//#include "SA_Builder.h"
+#include "Exp_EU_Builder.h"
+
+#include "Planner.h"
+#include "SANet/SANet.h"
+#include "SA_PlanHeuristics.h"
+#include "SA_PlanStrategy.h"
+
+//#include "SA_SchedStrategy.h"
+#include "Exp_EU_SchedStrategy.h"
+
+#include "SA_WorkingPlan.h"
+#include "TaskMap.h"
+
+using namespace SA_POP;
+
+// Constructor.
+Exp_EU_Builder::Exp_EU_Builder (void)
+{
+ // Nothing to do.
+};
+
+// Destructor.
+Exp_EU_Builder::~Exp_EU_Builder (void)
+{
+ // Nothing to do because client deletes Planner and Planner
+ // handles deletion of the rest of the objects.
+};
+
+// Create SA-POP objects.
+void Exp_EU_Builder::init (void)
+{
+ // Set init flag.
+ this->is_init_ = true;
+
+ // Create objects.
+ this->planner_ = new Planner ();
+ this->sanet_ = new SANet::Network ();
+ this->cond_choice_ = new SA_CondStrategy (this->planner_);
+ this->task_choice_ = new SA_TaskStrategy (this->planner_);
+ this->impl_choice_ = new SA_ImplStrategy (this->planner_);
+ this->plan_strat_ = new SA_PlanStrategy (this->planner_,
+ this->cond_choice_, this->task_choice_, this->impl_choice_);
+ this->sched_strat_ = new Exp_EU_SchedStrategy (this->planner_);
+ this->working_plan_ = new SA_WorkingPlan (this->planner_);
+ this->task_map_ = new TaskMap ();
+
+ // Provide PlanCommand prototypes to objects.
+ this->plan_strat_->set_commands (
+ this->working_plan_->get_AddTaskCmd (),
+ this->working_plan_->get_AssocTaskImplCmd (),
+ this->working_plan_->get_ResolveCLThreatCmd());
+ this->sched_strat_->set_commands (
+ this->working_plan_->get_ResolveSchedOrderCmd (),
+ this->working_plan_->get_AdjustMinTimesCmd (),
+ this->working_plan_->get_AdjustMaxTimesCmd ());
+ this->working_plan_->set_commands (
+ this->plan_strat_->get_AddOpenThreatsCmd ());
+
+ // Provide planning objects to Planner.
+ this->planner_->set_objects (
+ this->sanet_,
+ this->plan_strat_,
+ this->sched_strat_,
+ this->working_plan_,
+ this->task_map_);
+};