iso::flock::Behavior Class Reference

behavior class More...

#include <iso_flock_behavior.h>

Inherited by iso::flock::AccelerationBehavior, iso::flock::AlignmentBehavior, iso::flock::BoundaryMirrorBehavior, iso::flock::BoundaryRepulsionBehavior, iso::flock::BoundaryWrapBehavior, iso::flock::CircularBehavior, iso::flock::CohesionBehavior, iso::flock::ConeVisionBehavior, iso::flock::CopyBehavior, iso::flock::DampingBehavior, iso::flock::DistanceFieldFollowBehavior, iso::flock::EnvBehavior, iso::flock::EulerIntegration, iso::flock::EvasionBehavior, iso::flock::GridAvgBehavior, iso::flock::NeighborDirectionStoreBehavior, iso::flock::NeighborDistanceStoreBehavior, iso::flock::NeighborIndexStoreBehavior, iso::flock::NeighborStoreBehavior, iso::flock::OrbitBehavior, iso::flock::ParameterCombineBehavior, iso::flock::ParameterMagBehavior, iso::flock::ParameterMapBehavior, iso::flock::ParameterPrintBehavior, iso::flock::ParameterScaleBehavior, iso::flock::ParameterThresholdToEventBehavior, iso::flock::RandomizeBehavior, iso::flock::ResetBehavior, iso::flock::SpiralBehavior, iso::flock::SplineFollowBehavior, iso::flock::SwarmBehavior, iso::flock::TargetParameterBehavior, and TrackBehavior.

Inheritance diagram for iso::flock::Behavior:

Inheritance graph
[legend]
Collaboration diagram for iso::flock::Behavior:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Behavior (const base::String &pInputParameterString, const base::String &pOutputParameterString)
 create behavior
 Behavior (Agent *pAgent, const base::String &pBehaviorName, const base::String &pInputParameterString, const base::String &pOutputParameterString)
 create behavior
virtual ~Behavior ()
 destructor
virtual Behaviorcreate (const base::String &pBehaviorName, Agent *pSwarm) const =0
 create copy of behavior
virtual Behaviorcreate (const base::String &pInputParameterString, const base::String &pOutputParameterString) const =0
 create copy of behavior
const base::String & name () const
 return behavior name
base::String className () const
const base::String & inputParameterString () const
 return input parameter string
const base::String & outputParameterString () const
 return output parameter string
virtual void act ()=0
 perform behavior
virtual base::String info (int pPropagationLevel=0) const
 print behavior information

Protected Member Functions

 Behavior ()
 default constructor
virtual void createInputParameters () throw (FlockException)
 create input behavior parameters
Exceptions:
FlockException failed to create input parameters

virtual void createOutputParameters () throw (FlockException)
 create output behavior parameters
Exceptions:
FlockException failed to create output parameters

ParametercreateInternalParameter (const base::String &pParameterName, const math::Vector< real > &pValues)
 create internal behavior parameter
QVector< Parameter * > & internalParameters ()
 return internal behavior parameters

Protected Attributes

base::String mName
base::String mClassName
 behavior name
AgentmAgent
 behavior class name
base::String mInputParameterString
 agent this behavior belongs to
base::String mOutputParameterString
 unparsed string containing all input parameter names
QVector< Parameter * > mInputParameters
 unparsed string containing all output parameter names
QVector< space::NeighborGroup * > mInputNeighborGroups
 input parameters (behavior reads from them)
QVector< base::String > mNeighborInputParameterNames
 input neighbor groups (behavior reads from them)
QVector< Parameter * > mOutputParameters
 input parameter names for parameters that are retrieved via neighbor groups
QVector< space::NeighborGroup * > mOutputNeighborGroups
 output parameters (behavior writes to them)
QVector< base::String > mNeighborOutputParameterNames
 output neighbor groups (behavior writes to them)
QVector< Parameter * > mInternalParameters
 output parameter names for parameters that are retrieved via neighbor groups
ParametermActivePar
 internal parameters (including scales)

Friends

class Swarm
std::ostream & operator<< (std::ostream &pOstream, const Behavior &pBehavior)
 retrieve textual behavior info

Detailed Description

behavior class

Abstract base class for agent behaviors.
Any derived behavior class needs to implement an act methods, that is called once during each simulation step.

Input Parameter:

Output Parameter:

Internal Parameter:
name: xxx:active dim: 1D

Created by Daniel Bisig on 3/23/07.


Constructor & Destructor Documentation

Behavior::Behavior ( const base::String &  pInputParameterString,
const base::String &  pOutputParameterString 
)

create behavior

Parameters:
pInputParameterString input parameter string (parameters are space separated)
pOutputParameterString output paramaters are space separated)

Behavior::Behavior ( Agent pAgent,
const base::String &  pBehaviorName,
const base::String &  pInputParameterString,
const base::String &  pOutputParameterString 
)

create behavior

Parameters:
pAgent reference to agent to which this behavior is added
pBehaviorName behavior name
pInputParameterString input parameter string (parameters are space separated)
pOutputParameterString output paramaters are space separated)

Behavior::~Behavior (  )  [virtual]

destructor

Behavior::Behavior (  )  [protected]

default constructor


Member Function Documentation

virtual Behavior* iso::flock::Behavior::create ( const base::String &  pBehaviorName,
Agent pSwarm 
) const [pure virtual]

create copy of behavior

Parameters:
pSwarm swarm this behavior belongs to
pBehaviorName name of behavior
Returns:
new behavior

Implemented in iso::flock::EnvAgentInteractBehavior, iso::flock::EnvClampBehavior, iso::flock::EnvDecayBehavior, iso::flock::EnvDiffusionBehavior, iso::flock::EnvGiererMeinhardtBehavior, iso::flock::EnvGrayScottBehavior, iso::flock::AccelerationBehavior, iso::flock::AlignmentBehavior, iso::flock::BoundaryMirrorBehavior, iso::flock::BoundaryRepulsionBehavior, iso::flock::BoundaryWrapBehavior, iso::flock::CircularBehavior, iso::flock::CohesionBehavior, iso::flock::ConeVisionBehavior, iso::flock::CopyBehavior, iso::flock::DampingBehavior, iso::flock::DistanceFieldFollowBehavior, iso::flock::EvasionBehavior, iso::flock::GridAvgBehavior, iso::flock::NeighborDirectionStoreBehavior, iso::flock::NeighborDistanceStoreBehavior, iso::flock::NeighborIndexStoreBehavior, iso::flock::NeighborStoreBehavior, iso::flock::OrbitBehavior, iso::flock::ParameterCombineBehavior, iso::flock::ParameterMagBehavior, iso::flock::ParameterMapBehavior, iso::flock::ParameterPrintBehavior, iso::flock::ParameterScaleBehavior, iso::flock::ParameterThresholdToEventBehavior, iso::flock::RandomizeBehavior, iso::flock::ResetBehavior, iso::flock::SpiralBehavior, iso::flock::SplineFollowBehavior, iso::flock::StatisticsBehavior, iso::flock::TargetParameterBehavior, iso::flock::SwarmBehavior, iso::flock::EulerIntegration, and TrackBehavior.

virtual Behavior* iso::flock::Behavior::create ( const base::String &  pInputParameterString,
const base::String &  pOutputParameterString 
) const [pure virtual]

create copy of behavior

Parameters:
pInputParameterString input parameter string
pOutputParameterString output parameter string
Returns:
new behavior

Implemented in iso::flock::EnvAgentInteractBehavior, iso::flock::EnvClampBehavior, iso::flock::EnvDecayBehavior, iso::flock::EnvDiffusionBehavior, iso::flock::EnvGiererMeinhardtBehavior, iso::flock::EnvGrayScottBehavior, iso::flock::AccelerationBehavior, iso::flock::AlignmentBehavior, iso::flock::BoundaryMirrorBehavior, iso::flock::BoundaryRepulsionBehavior, iso::flock::BoundaryWrapBehavior, iso::flock::CircularBehavior, iso::flock::CohesionBehavior, iso::flock::ConeVisionBehavior, iso::flock::CopyBehavior, iso::flock::DampingBehavior, iso::flock::DistanceFieldFollowBehavior, iso::flock::EvasionBehavior, iso::flock::GridAvgBehavior, iso::flock::NeighborDirectionStoreBehavior, iso::flock::NeighborDistanceStoreBehavior, iso::flock::NeighborIndexStoreBehavior, iso::flock::NeighborStoreBehavior, iso::flock::OrbitBehavior, iso::flock::ParameterCombineBehavior, iso::flock::ParameterMagBehavior, iso::flock::ParameterMapBehavior, iso::flock::ParameterPrintBehavior, iso::flock::ParameterScaleBehavior, iso::flock::ParameterThresholdToEventBehavior, iso::flock::RandomizeBehavior, iso::flock::ResetBehavior, iso::flock::SpiralBehavior, iso::flock::SplineFollowBehavior, iso::flock::TargetParameterBehavior, iso::flock::SwarmBehavior, iso::flock::EulerIntegration, and TrackBehavior.

const base::String & Behavior::name (  )  const

return behavior name

Returns:
behavior name

base::String Behavior::className (  )  const

const base::String & Behavior::inputParameterString (  )  const

return input parameter string

Returns:
input parameter string

const base::String & Behavior::outputParameterString (  )  const

return output parameter string

Returns:
output parameter string

virtual void iso::flock::Behavior::act (  )  [pure virtual]

perform behavior

Implemented in iso::flock::EnvAgentInteractBehavior, iso::flock::EnvClampBehavior, iso::flock::EnvDecayBehavior, iso::flock::EnvDiffusionBehavior, iso::flock::EnvGiererMeinhardtBehavior, iso::flock::EnvGrayScottBehavior, iso::flock::AccelerationBehavior, iso::flock::AlignmentBehavior, iso::flock::BoundaryMirrorBehavior, iso::flock::BoundaryRepulsionBehavior, iso::flock::BoundaryWrapBehavior, iso::flock::CircularBehavior, iso::flock::CohesionBehavior, iso::flock::ConeVisionBehavior, iso::flock::CopyBehavior, iso::flock::DampingBehavior, iso::flock::DistanceFieldFollowBehavior, iso::flock::EvasionBehavior, iso::flock::GridAvgBehavior, iso::flock::NeighborDirectionStoreBehavior, iso::flock::NeighborDistanceStoreBehavior, iso::flock::NeighborIndexStoreBehavior, iso::flock::NeighborStoreBehavior, iso::flock::OrbitBehavior, iso::flock::ParameterCombineBehavior, iso::flock::ParameterMagBehavior, iso::flock::ParameterMapBehavior, iso::flock::ParameterPrintBehavior, iso::flock::ParameterScaleBehavior, iso::flock::ParameterThresholdToEventBehavior, iso::flock::RandomizeBehavior, iso::flock::ResetBehavior, iso::flock::SpiralBehavior, iso::flock::SplineFollowBehavior, iso::flock::StatisticsBehavior, iso::flock::TargetParameterBehavior, iso::flock::EnvBehavior, iso::flock::EulerIntegration, and TrackBehavior.

base::String Behavior::info ( int  pPropagationLevel = 0  )  const [virtual]

print behavior information

Parameters:
pPropagationLevel how far the propagation method proceeds through composite classes (-1: unlimited, 0: no proceeding, >0: limited proceeding)

Reimplemented in iso::flock::EnvBehavior, and iso::flock::SwarmBehavior.

void Behavior::createInputParameters (  )  throw (FlockException) [protected, virtual]

create input behavior parameters

Exceptions:
FlockException failed to create input parameters

Reimplemented in iso::flock::EnvBehavior.

void Behavior::createOutputParameters (  )  throw (FlockException) [protected, virtual]

create output behavior parameters

Exceptions:
FlockException failed to create output parameters

Reimplemented in iso::flock::EnvBehavior.

Parameter * Behavior::createInternalParameter ( const base::String &  pParameterName,
const math::Vector< real > &  pValues 
) [protected]

create internal behavior parameter

Parameters:
pParameterName name of parameter
pValues values of parameter
Returns:
parameter
creates an internal behavior parameter which is visible at the level of the agent (i.e. other behaviors can access it).
the name of the parameter is constructed as follows: behaviorName_parameterName.

QVector< Parameter * > & Behavior::internalParameters (  )  [protected]

return internal behavior parameters

Returns:
internal behavior parameters


Friends And Related Function Documentation

friend class Swarm [friend]

std::ostream& operator<< ( std::ostream &  pOstream,
const Behavior pBehavior 
) [friend]

retrieve textual behavior info

Parameters:
pOstream output text stream
pBehavior behavior


Member Data Documentation

base::String iso::flock::Behavior::mName [protected]

base::String iso::flock::Behavior::mClassName [protected]

behavior name

Agent* iso::flock::Behavior::mAgent [protected]

behavior class name

base::String iso::flock::Behavior::mInputParameterString [protected]

agent this behavior belongs to

base::String iso::flock::Behavior::mOutputParameterString [protected]

unparsed string containing all input parameter names

QVector<Parameter*> iso::flock::Behavior::mInputParameters [protected]

unparsed string containing all output parameter names

QVector<space::NeighborGroup*> iso::flock::Behavior::mInputNeighborGroups [protected]

input parameters (behavior reads from them)

QVector<base::String> iso::flock::Behavior::mNeighborInputParameterNames [protected]

input neighbor groups (behavior reads from them)

QVector<Parameter*> iso::flock::Behavior::mOutputParameters [protected]

input parameter names for parameters that are retrieved via neighbor groups

QVector<space::NeighborGroup*> iso::flock::Behavior::mOutputNeighborGroups [protected]

output parameters (behavior writes to them)

QVector<base::String> iso::flock::Behavior::mNeighborOutputParameterNames [protected]

output neighbor groups (behavior writes to them)

QVector<Parameter*> iso::flock::Behavior::mInternalParameters [protected]

output parameter names for parameters that are retrieved via neighbor groups

Parameter* iso::flock::Behavior::mActivePar [protected]

internal parameters (including scales)


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 15:28:03 2011 for iso_flock by  doxygen 1.5.1