mial::ControlCenter< Type, nDims > Class Template Reference

The brain of the organism responsible for making decisions and taking action based upon their outcome. More...

#include <ControlCenter.h>

Inheritance diagram for mial::ControlCenter< Type, nDims >:

mial::Ctrl_ScheduleDriven< Type, nDims > mial::Ctrl_SensoryDriven< Type, nDims > mial::Ctrl_VesselCrawler< Type, nDims, CrawlerPhysType > List of all members.

Public Types

typedef ControlCenter Self
typedef itk::SmartPointer<
Self
Pointer
typedef itk::SmartPointer<
const Self
ConstPointer
typedef itk::WeakPointer<
const Self
ConstWeakPointer

Public Member Functions

 ~ControlCenter ()
 Default destructor responsible for correctly destroying both behavior and sensor lists.
virtual bool update ()
 Update the cognitive layer (think!).
virtual bool setAllPhysics (Physics< Type, nDims > *p)
 Set all the behaviors to have the provided physics layer.
virtual Behavior< Type, nDims > * findBehavior (const std::string name)
 finds and returns a behavior with a particular name
virtual int getNumBehaviors ()
 Accessor returning the number of known behaviors.
virtual bool addBehavior (Behavior< Type, nDims > *b)
 Add a behavior to the list of known behaviors.

Protected Member Functions

 ControlCenter ()
 Default constructor.
void setBehaviorToRunStream (std::stringstream *a)
 Set behavior to run stream.
virtual bool decideNextBehavior ()=0
 Pure virtual member function, decides what behavior will be run after the current behavior is completed.
virtual bool runNextBehavior ()
 Run the next behavior decided upon by decideNextBehavior(). Will also run the current running behaviors clean up method (if the behavior is finished).
virtual bool updateCurrentBehavior ()
 Update the current behavior.

Protected Attributes

std::vector< typename Behavior<
Type, nDims >::Pointer
behaviorList
 The list of behaviors known to the cognitive center.
std::vector< Sensor::PointersensorList
 A list of sensors available to the control center.
Behavior< Type, nDims >::Pointer behaviorToRun
 The behavior to run next.
Behavior< Type, nDims >::behaviorIn * behaviorToRunStruct
 The arguments for the behavior to run next. This is the default behavior.
std::stringstream * behaviorToRunStream
 The arguments for the behavior to run next in string format.
int state
 The current state of the cognitive center.
int numBehaviors
 The number of known behaviors.

Detailed Description

template<class Type, int nDims>
class mial::ControlCenter< Type, nDims >

The brain of the organism responsible for making decisions and taking action based upon their outcome.

The cognitive layer of deformable organism is responsible for the decision making process. Essentially, this is the brain of the organism. It monitors the status, of the behaviors, deformations and sensors and makes decisions based upon their states and outputs.

This class exploits much of the complex versatility of the framework obtained through the use of ABCs, and IO streams and structures. Through a single list of sensors and behaviors, the cognitive center can perform a variety of actions on any defined geometrical or physical type. For example, the decision to "translate" will trigger a translate behavior, which will in turn trigger the appropriate translate deformation as it pertains to the particular physical layer of the model. By that same notion, the decision to sense the eccentricity of the model will trigger the appropriate sensor.

Definition at line 36 of file ControlCenter.h.


Member Function Documentation

template<class Type, int nDims>
bool mial::ControlCenter< Type, nDims >::addBehavior ( Behavior< Type, nDims > *  b  )  [virtual]

Add a behavior to the list of known behaviors.

Parameters:
b The behavior to be added.

Definition at line 37 of file ControlCenter.cxx.

References mial::ControlCenter< Type, nDims >::behaviorList, and mial::ControlCenter< Type, nDims >::numBehaviors.

template<class Type, int nDims>
Behavior< Type, nDims > * mial::ControlCenter< Type, nDims >::findBehavior ( const std::string  name  )  [virtual]

finds and returns a behavior with a particular name

Parameters:
name The name of the behavior to locate

Definition at line 22 of file ControlCenter.cxx.

References mial::ControlCenter< Type, nDims >::behaviorList, and mial::ControlCenter< Type, nDims >::numBehaviors.

Referenced by mial::Ctrl_ScheduleDriven< Type, nDims >::decideNextBehavior(), and mial::Ctrl_VesselCrawler< Type, nDims, CrawlerPhysType >::decideNextBehavior().

template<class Type, int nDims>
virtual bool mial::ControlCenter< Type, nDims >::update (  )  [inline, virtual]

Update the cognitive layer (think!).

If there is no current behavior, decide on one and run. Otherwise, if the behavior is finished clean it up then decide and run a new one. Otherwise keep running the current.

Definition at line 52 of file ControlCenter.h.


Member Data Documentation

template<class Type, int nDims>
std::vector<typename Behavior<Type,nDims>::Pointer> mial::ControlCenter< Type, nDims >::behaviorList [protected]

The list of behaviors known to the cognitive center.

The cognitive center maintains a list of named behaviors that it may run. Consequently, each behavior must be of the appropriate data type and dimensionality.

Definition at line 87 of file ControlCenter.h.

Referenced by mial::ControlCenter< Type, nDims >::addBehavior(), mial::ControlCenter< Type, nDims >::findBehavior(), and mial::ControlCenter< float, nDims >::setAllPhysics().


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 13:05:23 2006 for IDO by  doxygen 1.4.7