iso::flock::StatisticsBehavior Class Reference

statistics behavior More...

#include <iso_flock_statistics_behavior.h>

Inherits iso::flock::SwarmBehavior.

Inheritance diagram for iso::flock::StatisticsBehavior:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StatisticsBehavior (const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString)
 create swarm behavior
 StatisticsBehavior (Swarm *pSwarm, const base::String &pSwarmBehaviorName, const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString) throw (FlockException)
 create swarm behavior
 ~StatisticsBehavior ()
 destructor
virtual Behaviorcreate (const base::String &pBehaviorName, Agent *pSwarm) const throw (FlockException)
 create copy of behavior
virtual Behaviorcreate (const base::String &pInputSwarmParameterString, const base::String &pInputAgentParameterString, const base::String &pOutputSwarmParameterString, const base::String &pOutputAgentParameterString) const
 create copy of behavior
void act ()
 perform behavior

Protected Attributes

ParametermInputPar
ParametermMinPar
 input parameter
ParametermMaxPar
 minimum value parameter (internal)
ParametermAvgPar
 maximum value parameter (internal)
ParametermStdDevPar
 average value parameter (internal)
unsigned int mInputParIndex
 standard deviation parameter (internal)
Vector< float > mSquareSum
 input parameter index

Detailed Description

statistics behavior

A swarm behavior that conducts a very simple statistical analysis on the values of an agent input parameter and stores the result in internal parameters
The statistical output includes: minimum parameter value, maximum parameter value, average parameter value, standard deviation of agent parameters Input Parameter:
type: InputParameter dim: nD neighbors: ignore

Internal Parameter:
name: xxx_minimum dim: nD defaultValue: na
name: xxx_maximum dim: nD defaultValue: na
name: xxx_average dim: nD defaultValue: na
name: xxx_stdDev dim: nD defaultValue: na

Created by Daniel Bisig on 8/1/08.


Constructor & Destructor Documentation

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

StatisticsBehavior::StatisticsBehavior ( Swarm pSwarm,
const base::String &  pSwarmBehaviorName,
const base::String &  pInputSwarmParameterString,
const base::String &  pInputAgentParameterString,
const base::String &  pOutputSwarmParameterString,
const base::String &  pOutputAgentParameterString 
) throw (FlockException)

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)

StatisticsBehavior::~StatisticsBehavior (  ) 

destructor


Member Function Documentation

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

create copy of behavior

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

Implements iso::flock::SwarmBehavior.

Behavior * StatisticsBehavior::create ( const base::String &  pInputSwarmParameterString,
const base::String &  pInputAgentParameterString,
const base::String &  pOutputSwarmParameterString,
const base::String &  pOutputAgentParameterString 
) const [virtual]

create copy of behavior

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

Implements iso::flock::SwarmBehavior.

void StatisticsBehavior::act (  )  [virtual]

perform behavior

Implements iso::flock::Behavior.


Member Data Documentation

Parameter* iso::flock::StatisticsBehavior::mInputPar [protected]

Parameter* iso::flock::StatisticsBehavior::mMinPar [protected]

input parameter

Parameter* iso::flock::StatisticsBehavior::mMaxPar [protected]

minimum value parameter (internal)

Parameter* iso::flock::StatisticsBehavior::mAvgPar [protected]

maximum value parameter (internal)

Parameter* iso::flock::StatisticsBehavior::mStdDevPar [protected]

average value parameter (internal)

unsigned int iso::flock::StatisticsBehavior::mInputParIndex [protected]

standard deviation parameter (internal)

Vector<float> iso::flock::StatisticsBehavior::mSquareSum [protected]

input parameter index


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