54 #ifndef _GAMS_ALGORITHMS_KARL_H_
55 #define _GAMS_ALGORITHMS_KARL_H_
59 #include "madara/utility/EpochEnforcer.h"
87 const std::string & logic,
88 const std::string & store_result,
91 madara::knowledge::KnowledgeBase * knowledge = 0,
128 #ifndef _MADARA_NO_KARL_
146 madara::utility::EpochEnforcer<std::chrono::steady_clock>
enforcer_;
170 const madara::knowledge::KnowledgeMap & args,
171 madara::knowledge::KnowledgeBase * knowledge,
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Base class for algorithm factories that classes derived from.
The base class that algorithms in GAMS use.
A factory class for creating KarlEvaluator algorithms.
virtual BaseAlgorithm * create(const madara::knowledge::KnowledgeMap &args, madara::knowledge::KnowledgeBase *knowledge, platforms::BasePlatform *platform, variables::Sensors *sensors, variables::Self *self, variables::Agents *agents)
Creates an KarlEvaluator Algorithm.
An algorithm capable of executing other algorithms.
KarlEvaluator(const std::string &logic, const std::string &store_result, bool is_wait, double wait_time, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0, variables::Agents *agents=0)
Constructor.
madara::knowledge::EvalSettings settings_
the evaluation settings
bool is_wait_
indicates if the logic should be evaluated as a wait statement
void operator=(KarlEvaluator &rhs)
Assignment operator.
~KarlEvaluator()
Destructor.
virtual int plan(void)
Plans the next execution of the algorithm.
std::string logic_
original logic for debugging purposes
virtual int analyze(void)
Analyzes environment, platform, or other information.
madara::knowledge::CompiledExpression compiled_logic_
the compiled logic
virtual int execute(void)
Plans the next execution of the algorithm.
double wait_time_
indicates the time to wait. -1 means wait forever.
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
an enforcer for maximum time taken
A container for self referencing information.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
std::vector< Agent > Agents
An array of agent knowledge.
Contains all GAMS-related tools, classes and code.