Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

lm::StubDecider Class Reference

#include <StubDecider.h>

Inheritance diagram for lm::StubDecider:

lm::Decider List of all members.

Public Methods

 StubDecider (Effector *defaulteffect)
 ~StubDecider ()
virtual EffectormakeDecision ()
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)
AgentgetAgent ()

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
AgentmAgent

Detailed Description

The StubDecider is an stub implementation of the decider base class so that an agent can always have a decider even if one is not supplied by the developer.


Constructor & Destructor Documentation

lm::StubDecider::StubDecider Effector   defaulteffect [inline]
 

lm::StubDecider::~StubDecider   [inline]
 

destructor


Member Function Documentation

void lm::Decider::add std::list< Sensor * >    senses [inherited]
 

adds a list of sensors to this decider to look at

void lm::Decider::add Sensor   sense [inherited]
 

adds a sensor to this decider to look at

void lm::Decider::add Effector   effect [inherited]
 

adds an effector to this decider to choose from

void lm::Decider::add std::list< Effector * >    effects [inherited]
 

adds a list of effectors to this decider to choose from

void lm::Decider::append std::list< Sensor * >    senses [inherited]
 

void lm::Decider::append std::list< Effector * >    effects [inherited]
 

void lm::Decider::applyDecision Effector   e,
int    agentState
[inherited]
 

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.

Agent* lm::Decider::getAgent   [inline, inherited]
 

returns this decider's agent.

std::list< Effector * > lm::Decider::getEffectors   [inherited]
 

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.

std::list< Sensor * > lm::Decider::getSensors   [inherited]
 

std::list< boost::tuple< bool, Sensor * > > lm::Decider::getSensorsResults   [protected, inherited]
 

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

virtual Effector* lm::StubDecider::makeDecision   [inline, virtual]
 

overload the makeDecision method to return the first effector in the list as a default

Implements lm::Decider.

void lm::Decider::setAgent Agent   newAgent [inherited]
 

method that sets the decider's agent variable

void lm::Decider::setEffectors std::list< Effector * >    effects [inherited]
 

void lm::Decider::setSensors std::list< Sensor * >    senses [inherited]
 


Member Data Documentation

Agent* lm::Decider::mAgent [protected, inherited]
 

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

std::list<Effector*> lm::Decider::mEffectors [protected, inherited]
 

This is a list of effectors that I can choose to use

std::list<Sensor*> lm::Decider::mSensors [protected, inherited]
 

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.

std::list<boost::tuple<bool, Sensor*> > lm::Decider::mSensorsResults [protected, inherited]
 

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.


The documentation for this class was generated from the following file:
Generated on Wed Oct 22 21:33:22 2003 for AI Loom by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002