iso::flock::ParameterMapBehavior Class Reference

map input parameter into output parameter More...

#include <iso_flock_parameter_map_behavior.h>

Inherits iso::flock::Behavior.

Inheritance diagram for iso::flock::ParameterMapBehavior:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParameterMapBehavior (const base::String &pInputParameterString, const base::String &pOutputParameterString)
 create behavior
 ParameterMapBehavior (Agent *pAgent, const base::String &pBehaviorName, const base::String &pInputParameterString, const base::String &pOutputParameterString) throw (FlockException)
 create behavior
 ~ParameterMapBehavior ()
 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

ParametermInputPar
ParametermOutputPar
 input parameter
ParametermMapPar
 output parameter

Detailed Description

map input parameter into output parameter

parameter into output parameter

The Behavior maps input parameter into output parameter
Any combination of input parameter components can be combined, scaled and copied into any combination of output parameter components
This behavior can for instance be used to copy parameter values into a parameter of different dimension
Or it can be used to scale the range of some parameter components
The mapping relies on the values stored in the internal map parameter
This parameter represents the mapping as follows:
in0->out0, in0->out1,... in0->outY, in1->out0, in1->out1,... in1->outX,... inX->out0, inX->out1,... inX->outY
For example to map a 3D parameter to a 2D parameter by combining the second and third component of the input into the second component of the output: 1, 0, 0, 0, 0.5, 0.5
Input Parameter:
type: input dim: nD neighbors: ignored

Output Parameter:
type: output dim: mD write: replace

Internal Parameter:
name: xxx_map dim: m*nD defaultValue: 1.0 for all components that map input component into the same output component, 0.0 for all the others
name: xxx_active dim: 1D defaultValue: 0.1

Created by Daniel Bisig on 3/5/08.


Constructor & Destructor Documentation

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

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

ParameterMapBehavior::~ParameterMapBehavior (  ) 

destructor


Member Function Documentation

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

perform behavior

Implements iso::flock::Behavior.


Member Data Documentation

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

Parameter* iso::flock::ParameterMapBehavior::mOutputPar [protected]

input parameter

Parameter* iso::flock::ParameterMapBehavior::mMapPar [protected]

output parameter


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