54 #ifndef _GAMS_CONTROLLERS_MULTICONTROLLER_H_ 55 #define _GAMS_CONTROLLERS_MULTICONTROLLER_H_ 69 #include "madara/knowledge/containers/String.h" 70 #include "madara/knowledge/containers/Vector.h" 101 virtual int monitor (
void);
108 virtual int system_analyze (
void);
114 virtual int analyze (
void);
120 virtual int plan (
void);
126 virtual int execute (
void);
147 int run (
double loop_period = 0.0,
148 double max_runtime = -1,
149 double send_period = -1.0);
162 double max_runtime = -1,
163 double send_hz = -1.0)
165 double loop_rate, send_rate;
172 loop_rate = 1.0 / loop_hz;
176 send_rate = loop_rate;
179 send_rate = 1.0 / send_hz;
181 return run (loop_rate, max_runtime, send_rate);
189 void init_accent (
const std::string & algorithm,
190 const madara::knowledge::KnowledgeMap & args = madara::knowledge::KnowledgeMap ());
195 void clear_accents (
void);
205 void add_platform_factory (
206 const std::vector <std::string> & aliases,
217 void add_algorithm_factory (
218 const std::vector <std::string> & aliases,
226 void init_algorithm (
const std::string & algorithm,
227 const madara::knowledge::KnowledgeMap & args = madara::knowledge::KnowledgeMap ());
242 void init_platform (
const std::string & platform,
243 const madara::knowledge::KnowledgeMap & args =
244 madara::knowledge::KnowledgeMap ());
259 void init_algorithm (jobject algorithm);
265 void init_platform (jobject platform);
273 void init_vars (
const madara::knowledge::KnowledgeRecord::Integer &
id = 0,
274 const madara::knowledge::KnowledgeRecord::Integer & processes = -1);
339 int run_once_ (
void);
344 #endif // _GAMS_CONTROLLERS_MULTICONTROLLER_H_ Base class for algorithm factories that classes derived from.
A container for swarm information.
int run_hz(double loop_hz=0.0, double max_runtime=-1, double send_hz=-1.0)
Runs iterations of the MAPE loop with specified hertz.
std::vector< BaseAlgorithm * > Algorithms
std::map< std::string, AlgorithmStatus > Algorithms
a map of sensor names to the sensor information
madara::knowledge::KnowledgeBase & knowledge_
Knowledge base.
Copyright (c) 2014 Carnegie Mellon University.
platforms::BasePlatform * platform_
Platform on which the controller is running.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Copyright (c) 2014 Carnegie Mellon University.
std::vector< Agent > Agents
An array of agent knowledge.
variables::Algorithms algorithms_
Containers for algorithm information.
Copyright (c) 2014 Carnegie Mellon University.
algorithms::Algorithms accents_
Accents on the primary algorithm.
GAMS_EXPORT void init_vars(AccentStatuses &variables, madara::knowledge::KnowledgeBase &knowledge, const std::string &prefix)
Initializes accent status containers.
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
std::map< std::string, PlatformStatus > Platforms
a map of sensor names to the sensor information
variables::Self self_
Containers for self-referencing variables.
variables::Platforms platforms_
Containers for platform information.
algorithms::BaseAlgorithm * algorithm_
Algorithm to perform.
The base class that algorithms in GAMS use.
Copyright (c) 2014 Carnegie Mellon University.
Copyright (c) 2014-2018 Carnegie Mellon University.
A controller that has the capability of starting many different threads.
Copyright (c) 2014 Carnegie Mellon University.
variables::Sensors sensors_
Containers for sensor information.
variables::Swarm swarm_
Containers for swarm-related variables.
variables::Agents agents_
Containers for agent-related variables.