iso::flock::AlignmentBehavior Class Reference

velocity alignment behavior More...

#include <iso_flock_alignment_behavior.h>

Inherits iso::flock::Behavior.

Inheritance diagram for iso::flock::AlignmentBehavior:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AlignmentBehavior (const base::String &pInputParameterString, const base::String &pOutputParameterString)
 create behavior
 AlignmentBehavior (Agent *pAgent, const base::String &pBehaviorName, const base::String &pInputParameterString, const base::String &pOutputParameterString) throw (FlockException)
 create behavior
 ~AlignmentBehavior ()
 destructor
virtual Behavior * create (const base::String &pBehaviorName, Agent *pAgent) const throw (FlockException)
 create copy of behavior
virtual Behavior * create (const base::String &pInputParameterString, const base::String &pOutputParameterString) const
 create copy of behavior
void act ()
 perform behavior

Protected Attributes

Parameter * mPositionPar
Parameter * mVelocityPar
 position parameter (input)
Parameter * mForcePar
 velocity parameter (input)
Parameter * mMinDistPar
 force parameter (output)
Parameter * mMaxDistPar
 minimum distance parameter (internal)
Parameter * mAmountPar
 maximum distance parameter (internal)
space::NeighborGroup * mPositionNeighbors
 behavior amount parameter (internal)
math::Vector< real > mAvgVelocity
 position neighbor group
math::Vector< real > mTmpForce
 avg of neighboring velocities

Detailed Description

velocity alignment behavior

behavior

Behavior causes Agent to adapt its velocity to the velocities of its neighbors.
The behavior derives a force vector to adapt the velocity.

Input Parameter:
type: position dim: nD neighbors: required
type: velocity dim: nD neighbors: ignore

Output Parameter:
type: force dim: nD write: add

Internal Parameter:
name: xxx_mindist dim: 1D defaultValue: 0.0
name: xxx_maxdist dim: 1D defaultValue: 0.5
name: xxx_amount dim: 1D defaultValue: 0.1
name: xxx_active dim: 1D defaultValue: 1.0

Created by Daniel Bisig on 4/21/07.


Constructor & Destructor Documentation

AlignmentBehavior::AlignmentBehavior ( 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)

AlignmentBehavior::AlignmentBehavior ( Agent *  pAgent,
const base::String &  pBehaviorName,
const base::String &  pInputParameterString,
const base::String &  pOutputParameterString 
) throw (FlockException)

create behavior

Parameters:
pAgent agent this behavior belongs to
pBehaviorName name of behavior
pInputParameterString input parameter string (parameters are space separated)
pOutputParameterString output paramaters are space separated)
Exceptions:
FlockException wrong number of type of parameters

AlignmentBehavior::~AlignmentBehavior (  ) 

destructor


Member Function Documentation

Behavior * AlignmentBehavior::create ( const base::String &  pBehaviorName,
Agent *  pAgent 
) const throw (FlockException) [virtual]

create copy of behavior

Parameters:
pAgent agent this behavior belongs to
pBehaviorName name of behavior
Returns:
new behavior
Exceptions:
FlockException wrong number of type of parameters

Implements iso::flock::Behavior.

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

create copy of behavior

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

Implements iso::flock::Behavior.

void AlignmentBehavior::act (  )  [virtual]

perform behavior

Implements iso::flock::Behavior.


Member Data Documentation

Parameter* iso::flock::AlignmentBehavior::mPositionPar [protected]

Parameter* iso::flock::AlignmentBehavior::mVelocityPar [protected]

position parameter (input)

Parameter* iso::flock::AlignmentBehavior::mForcePar [protected]

velocity parameter (input)

Parameter* iso::flock::AlignmentBehavior::mMinDistPar [protected]

force parameter (output)

Parameter* iso::flock::AlignmentBehavior::mMaxDistPar [protected]

minimum distance parameter (internal)

Parameter* iso::flock::AlignmentBehavior::mAmountPar [protected]

maximum distance parameter (internal)

space::NeighborGroup* iso::flock::AlignmentBehavior::mPositionNeighbors [protected]

behavior amount parameter (internal)

math::Vector<real> iso::flock::AlignmentBehavior::mAvgVelocity [protected]

position neighbor group

math::Vector<real> iso::flock::AlignmentBehavior::mTmpForce [protected]

avg of neighboring velocities


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