iso::flock::SwarmBehavior Class Reference

swarm behavior More...

#include <iso_flock_swarm_behavior.h>

Inherits iso::flock::Behavior.

Inherited by iso::flock::StatisticsBehavior.

Inheritance diagram for iso::flock::SwarmBehavior:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SwarmBehavior (const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString)
 create swarm behavior
 SwarmBehavior (Swarm *pSwarm, const base::String &pSwarmBehaviorName, const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString)
 create swarm behavior
virtual ~SwarmBehavior ()
 destructor
virtual Behaviorcreate (const base::String &pBehaviorName, Agent *pSwarm) const =0
 create copy of behavior
virtual Behaviorcreate (const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString) const =0
 create copy of behavior
void createAgentParameterIndices ()
 create agent parameter indices
const base::String & inputSwarmParameterString () const
 return input swarm parameter string
const base::String & outputSwarmParameterString () const
 return output swarm parameter string
const base::String & inputAgentParameterString () const
 return input agent parameter string
const base::String & outputAgentParameterString () const
 return output agent parameter string
virtual base::String info (int pPropagationLevel=0) const
 print behavior information

Protected Member Functions

 SwarmBehavior ()
 default constructor
Behaviorcreate (const base::String &pInputParameterString, const base::String &pOutputParameterString) const
 create copy of behavior
void createInputSwarmParameters () throw (FlockException)
 create swarm input behavior parameters
Exceptions:
FlockException failed to create swarm input parameters

void createOutputSwarmParameters () throw (FlockException)
 create swarm output behavior parameters
Exceptions:
FlockException failed to create swarm output parameters

ParametercreateInternalSwarmParameter (const base::String &pSwarmParameterName, const math::Vector< real > &pValues)
 create internal swarm behavior parameter

Protected Attributes

SwarmmSwarm
base::String mInputSwarmParameterString
 swarm this behavior belongs to
base::String mOutputSwarmParameterString
 unparsed string containing all swarm input parameter names
QVector< Parameter * > mInputSwarmParameters
 unparsed string containing all swarm output parameter names
QVector< space::NeighborGroup * > mInputSwarmNeighborGroups
 input swarm parameters (behavior reads from them)
QVector< Parameter * > mOutputSwarmParameters
 input swarm neighbor groups (behavior reads from them)
QVector< Parameter * > mInternalSwarmParameters
 output swarm parameters (behavior writes to them)
QVector< Parameter * > & mInputAgentParameters
 internal swarm parameters (including scales)
QVector< space::NeighborGroup * > & mInputAgentNeighborGroups
 input agent parameters (behavior reads from them)
QVector< Parameter * > & mOutputAgentParameters
 input agent neighbor groups (behavior reads from them)
QVector< space::NeighborGroup * > & mOutputAgentNeighborGroups
 output agent parameters (behavior writes to them)
QVector< Parameter * > & mInternalAgentParameters
 output agent neighbor groups (behavior writes to them)
QVector< unsigned int > mInputAgentParameterIndices
 internal agent parameters (including scales)
QVector< unsigned int > mInputAgentNeighborGroupIndices
 input agent parameter indices
QVector< unsigned int > mOutputAgentParameterIndices
 input agent neighbor group indices
QVector< unsigned int > mOutputAgentNeighborGroupIndices
 output agent parameter indices
QVector< unsigned int > mInternalAgentParameterIndices
 output agent neighbor group indices

Friends

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

Detailed Description

swarm behavior

Created by Daniel Bisig on 8/1/08.


Constructor & Destructor Documentation

SwarmBehavior::SwarmBehavior ( const base::String &  pInputSwarmParameterString,
const base::String &  pInputAgentParameterString,
const base::String &  pOutputSwarmParameterString,
const base::String &  pOutputAgentParameterString 
)

create swarm behavior

Parameters:
pInputSwarmParameterString input swarm parameter string (parameters are space separated)
pInputAgentParameterString input agent parameter string (parameters are space separated)
pOutputSwarmParameterString output swarm parameter string (paramaters are space separated)
pOutputAgentParameterString output agent parameter string (paramaters are space separated)

SwarmBehavior::SwarmBehavior ( Swarm pSwarm,
const base::String &  pSwarmBehaviorName,
const base::String &  pInputSwarmParameterString,
const base::String &  pInputAgentParameterString,
const base::String &  pOutputSwarmParameterString,
const base::String &  pOutputAgentParameterString 
)

create swarm behavior

Parameters:
pSwarm reference to swarm to which this behavior is added
pSwarmBehaviorName swarm behavior name
pInputSwarmParameterString input swarm parameter string (parameters are space separated)
pInputAgentParameterString input agent parameter string (parameters are space separated)
pOutputSwarmParameterString output swarm parameter string (parameters are space separated)
pOutputAgentParameterString output agent parameter string (parameters are space separated)

SwarmBehavior::~SwarmBehavior (  )  [virtual]

destructor

SwarmBehavior::SwarmBehavior (  )  [protected]

default constructor


Member Function Documentation

virtual Behavior* iso::flock::SwarmBehavior::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

Implements iso::flock::Behavior.

Implemented in iso::flock::StatisticsBehavior.

virtual Behavior* iso::flock::SwarmBehavior::create ( const base::String &  pInputSwarmParameterString,
const base::String &  pInputAgentParameterString,
const base::String &  pOutputSwarmParameterString,
const base::String &  pOutputAgentParameterString 
) const [pure virtual]

create copy of behavior

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

Implemented in iso::flock::StatisticsBehavior.

void SwarmBehavior::createAgentParameterIndices (  ) 

create agent parameter indices

const base::String & SwarmBehavior::inputSwarmParameterString (  )  const

return input swarm parameter string

Returns:
input swarm parameter string

const base::String & SwarmBehavior::outputSwarmParameterString (  )  const

return output swarm parameter string

Returns:
output swarm parameter string

const base::String & SwarmBehavior::inputAgentParameterString (  )  const

return input agent parameter string

Returns:
input agent parameter string

const base::String & SwarmBehavior::outputAgentParameterString (  )  const

return output agent parameter string

Returns:
output agent parameter string

base::String SwarmBehavior::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 from iso::flock::Behavior.

Behavior * SwarmBehavior::create ( const base::String &  pInputParameterString,
const base::String &  pOutputParameterString 
) const [protected, virtual]

create copy of behavior

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

Implements iso::flock::Behavior.

void SwarmBehavior::createInputSwarmParameters (  )  throw (FlockException) [protected]

create swarm input behavior parameters

Exceptions:
FlockException failed to create swarm input parameters

void SwarmBehavior::createOutputSwarmParameters (  )  throw (FlockException) [protected]

create swarm output behavior parameters

Exceptions:
FlockException failed to create swarm output parameters

Parameter * SwarmBehavior::createInternalSwarmParameter ( const base::String &  pSwarmParameterName,
const math::Vector< real > &  pValues 
) [protected]

create internal swarm behavior parameter

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


Friends And Related Function Documentation

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

retrieve textual behavior info

Parameters:
pOstream output text stream
pBehavior behavior


Member Data Documentation

Swarm* iso::flock::SwarmBehavior::mSwarm [protected]

base::String iso::flock::SwarmBehavior::mInputSwarmParameterString [protected]

swarm this behavior belongs to

base::String iso::flock::SwarmBehavior::mOutputSwarmParameterString [protected]

unparsed string containing all swarm input parameter names

QVector<Parameter*> iso::flock::SwarmBehavior::mInputSwarmParameters [protected]

unparsed string containing all swarm output parameter names

QVector<space::NeighborGroup*> iso::flock::SwarmBehavior::mInputSwarmNeighborGroups [protected]

input swarm parameters (behavior reads from them)

QVector<Parameter*> iso::flock::SwarmBehavior::mOutputSwarmParameters [protected]

input swarm neighbor groups (behavior reads from them)

QVector<Parameter*> iso::flock::SwarmBehavior::mInternalSwarmParameters [protected]

output swarm parameters (behavior writes to them)

QVector<Parameter*>& iso::flock::SwarmBehavior::mInputAgentParameters [protected]

internal swarm parameters (including scales)

QVector<space::NeighborGroup*>& iso::flock::SwarmBehavior::mInputAgentNeighborGroups [protected]

input agent parameters (behavior reads from them)

QVector<Parameter*>& iso::flock::SwarmBehavior::mOutputAgentParameters [protected]

input agent neighbor groups (behavior reads from them)

QVector<space::NeighborGroup*>& iso::flock::SwarmBehavior::mOutputAgentNeighborGroups [protected]

output agent parameters (behavior writes to them)

QVector<Parameter*>& iso::flock::SwarmBehavior::mInternalAgentParameters [protected]

output agent neighbor groups (behavior writes to them)

QVector<unsigned int> iso::flock::SwarmBehavior::mInputAgentParameterIndices [protected]

internal agent parameters (including scales)

QVector<unsigned int> iso::flock::SwarmBehavior::mInputAgentNeighborGroupIndices [protected]

input agent parameter indices

QVector<unsigned int> iso::flock::SwarmBehavior::mOutputAgentParameterIndices [protected]

input agent neighbor group indices

QVector<unsigned int> iso::flock::SwarmBehavior::mOutputAgentNeighborGroupIndices [protected]

output agent parameter indices

QVector<unsigned int> iso::flock::SwarmBehavior::mInternalAgentParameterIndices [protected]

output agent neighbor group indices


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