GAMS  1.2.2
KarlEvaluator.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ALGORITHMS_KARL_H_
55 #define _GAMS_ALGORITHMS_KARL_H_
56 
59 #include "madara/utility/EpochEnforcer.h"
60 
61 namespace gams
62 {
63  namespace algorithms
64  {
69  {
70  public:
87  const std::string & logic,
88  const std::string & store_result,
89  bool is_wait,
90  double wait_time,
91  madara::knowledge::KnowledgeBase * knowledge = 0,
92  platforms::BasePlatform * platform = 0,
93  variables::Sensors * sensors = 0,
94  variables::Self * self = 0,
95  variables::Agents * agents = 0);
96 
100  ~KarlEvaluator ();
101 
106  void operator= (KarlEvaluator & rhs);
107 
112  virtual int analyze (void);
113 
118  virtual int execute (void);
119 
124  virtual int plan (void);
125 
126  protected:
127 
129  madara::knowledge::CompiledExpression compiled_logic_;
130 
132  madara::knowledge::EvalSettings settings_;
133 
135  std::string logic_;
136 
138  bool is_wait_;
139 
141  double wait_time_;
142 
144  madara::utility::EpochEnforcer<std::chrono::steady_clock> enforcer_;
145  };
146 
151  {
152  public:
167  virtual BaseAlgorithm * create (
168  const madara::knowledge::KnowledgeMap & args,
169  madara::knowledge::KnowledgeBase * knowledge,
170  platforms::BasePlatform * platform,
171  variables::Sensors * sensors,
172  variables::Self * self,
173  variables::Agents * agents);
174  };
175  }
176 }
177 
178 #endif // _GAMS_ALGORITHMS_KARL_H_
Base class for algorithm factories that classes derived from.
madara::knowledge::CompiledExpression compiled_logic_
the compiled logic
std::string logic_
original logic for debugging purposes
An algorithm capable of executing other algorithms.
Definition: KarlEvaluator.h:68
Copyright (c) 2014 Carnegie Mellon University.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
The base platform for all platforms to use.
Definition: BasePlatform.h:190
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
madara::knowledge::EvalSettings settings_
the evaluation settings
A factory class for creating KarlEvaluator algorithms.
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
an enforcer for maximum time taken
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
double wait_time_
indicates the time to wait. -1 means wait forever.
#define GAMS_EXPORT
Definition: GamsExport.h:20
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:94
Copyright (c) 2014 Carnegie Mellon University.
bool is_wait_
indicates if the logic should be evaluated as a wait statement