#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:
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 Behavior * | create (const base::String &pBehaviorName, Agent *pSwarm) const =0 | |||
create copy of behavior | ||||
virtual Behavior * | create (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
| ||||
virtual void | createOutputParameters () throw (FlockException) | |||
create output behavior parameters
| ||||
Parameter * | createInternalParameter (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 | ||||
Agent * | mAgent | |||
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 | ||||
Parameter * | mActivePar | |||
internal parameters (including scales) | ||||
Friends | ||||
class | Swarm | |||
std::ostream & | operator<< (std::ostream &pOstream, const Behavior &pBehavior) | |||
retrieve textual behavior info |
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.
Behavior::Behavior | ( | const base::String & | pInputParameterString, | |
const base::String & | pOutputParameterString | |||
) |
create behavior
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
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
virtual Behavior* iso::flock::Behavior::create | ( | const base::String & | pBehaviorName, | |
Agent * | pSwarm | |||
) | const [pure virtual] |
create copy of behavior
pSwarm | swarm this behavior belongs to | |
pBehaviorName | name of 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
pInputParameterString | input parameter string | |
pOutputParameterString | output parameter string |
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
base::String Behavior::className | ( | ) | const |
const base::String & Behavior::inputParameterString | ( | ) | const |
return input parameter string
const base::String & Behavior::outputParameterString | ( | ) | const |
return 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
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
FlockException | failed to create input parameters |
Reimplemented in iso::flock::EnvBehavior.
void Behavior::createOutputParameters | ( | ) | throw (FlockException) [protected, virtual] |
create output behavior parameters
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
pParameterName | name of parameter | |
pValues | values of parameter |
QVector< Parameter * > & Behavior::internalParameters | ( | ) | [protected] |
return internal behavior parameters
friend class Swarm [friend] |
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Behavior & | pBehavior | |||
) | [friend] |
retrieve textual behavior info
pOstream | output text stream | |
pBehavior | behavior |
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)