#include <iso_flock_parameter_map_behavior.h>
Inherits iso::flock::Behavior.
Inheritance diagram for iso::flock::ParameterMapBehavior:
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 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 * | mInputPar |
Parameter * | mOutputPar |
input parameter | |
Parameter * | mMapPar |
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.
ParameterMapBehavior::ParameterMapBehavior | ( | const base::String & | pInputParameterString, | |
const base::String & | pOutputParameterString | |||
) |
create behavior
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
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 |
ParameterMapBehavior::~ParameterMapBehavior | ( | ) |
destructor
Behavior * ParameterMapBehavior::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 * ParameterMapBehavior::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 ParameterMapBehavior::act | ( | ) | [virtual] |
Parameter* iso::flock::ParameterMapBehavior::mInputPar [protected] |
Parameter* iso::flock::ParameterMapBehavior::mOutputPar [protected] |
input parameter
Parameter* iso::flock::ParameterMapBehavior::mMapPar [protected] |
output parameter