iso::flock::OrbitBehavior Class Reference

cause agents to orbit around the positions of neighboring agents More...

#include <iso_flock_orbit_behavior.h>

Inherits iso::flock::Behavior.

Inheritance diagram for iso::flock::OrbitBehavior:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Protected Attributes

ParametermPositionPar
ParametermVelocityPar
 position parameter (input)
ParametermForcePar
 velocity parameter (input)
ParametermFrequencyPar
 force parameter (output)
ParametermPhasePar
 frequency parameter (internal)
ParametermMinDistPar
 phase parameter (internal)
ParametermMaxDistPar
 minimum distance parameter (internal)
ParametermRadAmountPar
 maximum distance parameter (internal)
ParametermTanAmountPar
 radial amount parameter (internal)
ParametermAmountPar
 tangential amount parameter (internal)
space::NeighborGroup * mPositionNeighbors
 behaviour amount parameter (internal)
math::Vector3< realmNormDirection
 position neighbor group
math::Vector3< realmNormVelocity
 brief normalized neighbor direction
math::Vector3< realmCrossVec
 normalized agent velocity
math::Vector3< realmCrossVec2
 vector cross product (norm dir, norm vel)
math::Vector< realmAvgDirection
 normalized agent velocity (cross vec, norm dir)
math::Vector< realmTmpForce
 avg of neighboring value directions

Detailed Description

cause agents to orbit around the positions of neighboring agents

to orbit around the positions of neighboring agents

This behavior causes agents to orbit around the positions of neighboring agents.
A cosine function that extends from the position of the neighboring agent establishes rings of concentric peaks and valleys to which the oribiting agent respond to.
Peaks in the cosine function are avoided by the orbiting agent.
Valleys in the cosine function attract the orbiting agent.
The frequency and position of the cosine function's peaks and valleys can be controlled via the phase abd frequency parameters.
The radAmount parameter controls the attraction and repulsion of the orbiting agent perpendicular to the rings of peaks and valleys
. The tanAmount parameter controls the acceleration of the orbiting agent in a tangential direction with respect to the rings of peaks and valleys
. The orbiting behavior is active when an agent is within a distance from the neighbor agent that lies within the values of minDist and maxDist parameters.
The amount parameter controls the strength of the orbiting behavior.

The Behavior causes Agent to move withing a ring
Input Parameter:
type: position dim: nD neighbors: required
type: velocity dim: nD neighbors: ignored

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

Internal Parameter:
name: xxx_frequency dim: 1D defaultValue: 2.0
name: xxx_phase dim: 1D defaultValue: 0.0
name: xxx_minDist dim: 1D defaultValue: 0.0
name: xxx_maxDist dim: 1D defaultValue: 0.5
name: xxx_radAmount dim: 1D defaultValue: 3.0
name: xxx_tanAmount dim: 1D defaultValue: 6.0
name: xxx_amount dim: 1D defaultValue: 0.1

Created by Daniel Bisig, Tasuo Unemi, Koichiro Mori, John Flury on 11/16/07.


Constructor & Destructor Documentation

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

OrbitBehavior::OrbitBehavior ( 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

OrbitBehavior::~OrbitBehavior (  ) 

destructor


Member Function Documentation

Behavior * OrbitBehavior::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 * OrbitBehavior::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 OrbitBehavior::act (  )  [virtual]

perform behavior

Implements iso::flock::Behavior.


Member Data Documentation

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

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

position parameter (input)

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

velocity parameter (input)

Parameter* iso::flock::OrbitBehavior::mFrequencyPar [protected]

force parameter (output)

Parameter* iso::flock::OrbitBehavior::mPhasePar [protected]

frequency parameter (internal)

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

phase parameter (internal)

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

minimum distance parameter (internal)

Parameter* iso::flock::OrbitBehavior::mRadAmountPar [protected]

maximum distance parameter (internal)

Parameter* iso::flock::OrbitBehavior::mTanAmountPar [protected]

radial amount parameter (internal)

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

tangential amount parameter (internal)

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

behaviour amount parameter (internal)

math::Vector3<real> iso::flock::OrbitBehavior::mNormDirection [protected]

position neighbor group

math::Vector3<real> iso::flock::OrbitBehavior::mNormVelocity [protected]

brief normalized neighbor direction

math::Vector3<real> iso::flock::OrbitBehavior::mCrossVec [protected]

normalized agent velocity

math::Vector3<real> iso::flock::OrbitBehavior::mCrossVec2 [protected]

vector cross product (norm dir, norm vel)

math::Vector<real> iso::flock::OrbitBehavior::mAvgDirection [protected]

normalized agent velocity (cross vec, norm dir)

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

avg of neighboring value directions


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