A highly extensible MAPE loop.
More...
#include <MapeLoop.h>
|
| MapeLoop (madara::knowledge::KnowledgeBase &knowledge) |
| Constructor. More...
|
|
| ~MapeLoop () |
| Destructor. More...
|
|
void | define_analyze (madara::knowledge::KnowledgeRecord(*func)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &)) |
| Defines the analyze function (the A of MAPE). More...
|
|
void | define_execute (madara::knowledge::KnowledgeRecord(*func)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &)) |
| Defines the execute function (the E of MAPE). More...
|
|
void | define_mape (const std::string &loop="monitor (); analyze (); plan (); execute ()") |
| Defines the MAPE loop. More...
|
|
void | define_monitor (madara::knowledge::KnowledgeRecord(*func)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &)) |
| Defines the monitor function (the M of MAPE). More...
|
|
void | define_plan (madara::knowledge::KnowledgeRecord(*func)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &)) |
| Defines the plan function (the P of MAPE). More...
|
|
void | init_vars (madara::knowledge::KnowledgeBase &knowledge, const madara::knowledge::KnowledgeRecord::Integer &id=0, const madara::knowledge::KnowledgeRecord::Integer &processes=-1) |
| Initializes global variable containers. More...
|
|
madara::knowledge::KnowledgeRecord | run (double period=0.5, double max_runtime=-1) |
| Runs one iteration of the MAPE loop. More...
|
|
A highly extensible MAPE loop.
Definition at line 78 of file MapeLoop.h.
gams::controllers::MapeLoop::MapeLoop |
( |
madara::knowledge::KnowledgeBase & |
knowledge | ) |
|
Constructor.
- Parameters
-
knowledge | The knowledge base to reference and mutate |
gams::controllers::MapeLoop::~MapeLoop |
( |
| ) |
|
void gams::controllers::MapeLoop::define_analyze |
( |
madara::knowledge::KnowledgeRecord(*)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &) |
func | ) |
|
Defines the analyze function (the A of MAPE).
This function should return a 0 unless the MAPE loop should stop.
- Parameters
-
void gams::controllers::MapeLoop::define_execute |
( |
madara::knowledge::KnowledgeRecord(*)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &) |
func | ) |
|
Defines the execute function (the E of MAPE).
This function should return a 0 unless the MAPE loop should stop.
- Parameters
-
void gams::controllers::MapeLoop::define_mape |
( |
const std::string & |
loop = "monitor (); analyze (); plan (); execute ()" | ) |
|
void gams::controllers::MapeLoop::define_monitor |
( |
madara::knowledge::KnowledgeRecord(*)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &) |
func | ) |
|
Defines the monitor function (the M of MAPE).
This function should return a 0 unless the MAPE loop should stop.
- Parameters
-
void gams::controllers::MapeLoop::define_plan |
( |
madara::knowledge::KnowledgeRecord(*)(madara::knowledge::FunctionArguments &, madara::knowledge::Variables &) |
func | ) |
|
Defines the plan function (the P of MAPE).
This function should return a 0 unless the MAPE loop should stop.
- Parameters
-
void gams::controllers::MapeLoop::init_vars |
( |
madara::knowledge::KnowledgeBase & |
knowledge, |
|
|
const madara::knowledge::KnowledgeRecord::Integer & |
id = 0 , |
|
|
const madara::knowledge::KnowledgeRecord::Integer & |
processes = -1 |
|
) |
| |
Initializes global variable containers.
- Parameters
-
knowledge | the knowledge base to reference |
id | node identifier |
processes | processes |
madara::knowledge::KnowledgeRecord gams::controllers::MapeLoop::run |
( |
double |
period = 0.5 , |
|
|
double |
max_runtime = -1 |
|
) |
| |
Runs one iteration of the MAPE loop.
- Parameters
-
period | time between executions of the loop |
max_runtime | maximum runtime within the MAPE loop |
- Returns
- the result of the MAPE loop
Containers for agent-related variables.
Definition at line 160 of file MapeLoop.h.
madara::knowledge::KnowledgeBase& gams::controllers::MapeLoop::knowledge_ |
|
protected |
madara::knowledge::CompiledExpression gams::controllers::MapeLoop::mape_loop_ |
|
protected |
Containers for self-referencing variables.
Definition at line 169 of file MapeLoop.h.
Containers for sensor information.
Definition at line 172 of file MapeLoop.h.
Containers for swarm-related variables.
Definition at line 175 of file MapeLoop.h.
The documentation for this class was generated from the following file: