#include <iso_flock_orbit_behavior.h>
Inherits iso::flock::Behavior.
Inheritance diagram for iso::flock::OrbitBehavior:
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 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 * | mFrequencyPar |
force parameter (output) | |
Parameter * | mPhasePar |
frequency parameter (internal) | |
Parameter * | mMinDistPar |
phase parameter (internal) | |
Parameter * | mMaxDistPar |
minimum distance parameter (internal) | |
Parameter * | mRadAmountPar |
maximum distance parameter (internal) | |
Parameter * | mTanAmountPar |
radial amount parameter (internal) | |
Parameter * | mAmountPar |
tangential amount parameter (internal) | |
space::NeighborGroup * | mPositionNeighbors |
behaviour amount parameter (internal) | |
math::Vector3< real > | mNormDirection |
position neighbor group | |
math::Vector3< real > | mNormVelocity |
brief normalized neighbor direction | |
math::Vector3< real > | mCrossVec |
normalized agent velocity | |
math::Vector3< real > | mCrossVec2 |
vector cross product (norm dir, norm vel) | |
math::Vector< real > | mAvgDirection |
normalized agent velocity (cross vec, norm dir) | |
math::Vector< real > | mTmpForce |
avg of neighboring value directions |
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.
OrbitBehavior::OrbitBehavior | ( | const base::String & | pInputParameterString, | |
const base::String & | pOutputParameterString | |||
) |
create behavior
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
pAgent | agent this behavior belongs to | |
pBehaviorName | name of behavior | |
pInputParameterString | input parameter string (parameters are space separated) | |
pOutputParameterString | output paramaters are space separated) |
FlockException | wrong number of type of parameters |
OrbitBehavior::~OrbitBehavior | ( | ) |
destructor
Behavior * OrbitBehavior::create | ( | const base::String & | pBehaviorName, | |
Agent * | pAgent | |||
) | const throw (FlockException) [virtual] |
create copy of behavior
pAgent | agent this behavior belongs to | |
pBehaviorName | name of behavior |
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
pInputParameterString | input parameter string | |
pOutputParameterString | output parameter string |
Implements iso::flock::Behavior.
void OrbitBehavior::act | ( | ) | [virtual] |
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