#include <Decider.h>
Inheritance diagram for lm::Decider:
Public Methods | |
Decider (Effector *defaultEffect) | |
Decider () | |
virtual | ~Decider () |
void | append (std::list< Effector * > effects) |
void | append (std::list< Sensor * > senses) |
void | add (std::list< Effector * > effects) |
void | add (Effector &effect) |
void | add (Sensor &sense) |
void | add (std::list< Sensor * > senses) |
void | setEffectors (std::list< Effector * > effects) |
void | setSensors (std::list< Sensor * > senses) |
std::list< Effector * > | getEffectors () |
std::list< Sensor * > | getSensors () |
void | setAgent (Agent *newAgent) |
void | applyDecision (Effector *e, int agentState) |
virtual Effector * | makeDecision ()=0 |
Agent * | getAgent () |
Protected Methods | |
std::list< boost::tuple< bool, Sensor * > > | getSensorsResults () |
Protected Attributes | |
std::list< Effector * > | mEffectors |
std::list< Sensor * > | mSensors |
std::list< boost::tuple< bool, Sensor * > > | mSensorsResults |
Agent * | mAgent |
|
|
|
|
|
|
|
adds a list of sensors to this decider to look at |
|
adds a sensor to this decider to look at |
|
adds an effector to this decider to choose from |
|
adds a list of effectors to this decider to choose from |
|
|
|
|
|
this method is called internally to loom. It calls the makeDecision method that the user wrote and then determins what to do with the effector that makeDecision generates. |
|
returns this decider's agent. |
|
these methods exist so that the agent can get direct access into the effector and sensor lists of each agent in case he needs to swap deciders at run time. These should not be used by application developers. |
|
|
|
This method is used to get the sensors and their results and store them in the boost::tuple. The reason we do this is that we need a |
|
as a developer when you create a new agent by deriving from this class you only need to overload this method. Loom takes care of the rest Implemented in lm::StubDecider. |
|
method that sets the decider's agent variable |
|
|
|
|
|
this is just a reference to the agent that we belong to. This allows us to get info from the agent about network related stuff |
|
This is a list of effectors that I can choose to use |
|
this is a list of sensors that I have that get checked continuously. If a developer needs access to the sensors and their output then they must use the mSensorsResults list. |
|
This is a list of boost::tuples that contain the sensor|boolean result pair. This list is updated continuously by the agent. So the application developer can look at this tuple and immediately know what the current status is of the agent. XXX: the reason that we use boost::tuple instead of a map is that in the future we may open up the sensor api to return any type and then we couldn't use map anymore because the types might vary so we go with tuples which could easily rewrite to take any type. |