#include <iso_flock_parameter.h>
Inherited by iso::flock::EnvParameter.
Inheritance diagram for iso::flock::Parameter:
Public Member Functions | |
Parameter (Agent *pAgent, const base::String &pName, unsigned int pDim) | |
create parameter | |
Parameter (Agent *pAgent, const base::String &pName, const math::Vector< real > &pValues) | |
create parameter | |
Parameter (Agent *pAgent, Parameter &pParameter) | |
copy constructor | |
virtual | ~Parameter () |
destructor | |
const base::String & | name () const |
return name | |
virtual unsigned int | count () const |
returns expected number of values | |
virtual void | set (real pValue) |
set values | |
virtual void | set (unsigned int pValueCount, const real *pValues) throw (FlockException) |
set values | |
virtual void | set (const math::Vector< real > pValues) throw (FlockException) |
set values | |
virtual void | change (real pValue) |
change values | |
virtual void | change (unsigned int pValueCount, real *pValues) throw (FlockException) |
change values | |
virtual void | change (const math::Vector< real > pValues) throw (FlockException) |
change values | |
virtual void | randomize (real pMinParameterValue, real pMaxParameterValue) |
randomize parameter value | |
virtual void | randomize (const math::Vector< real > &pMinParameterValues, const math::Vector< real > &pMaxParameterValues) throw (FlockException) |
randomize parameter value | |
Agent * | agent () |
return agent this parameter belongs to | |
math::Vector< real > & | values () |
return parameter values | |
const math::Vector< real > & | values () const |
return parameter values | |
real & | value (unsigned int pIndex=0) throw (FlockException) |
return parameter value | |
math::Vector< real > & | backupValues () |
return parameter backup values | |
real & | backupValue (unsigned int pIndex=0) throw (FlockException) |
return parameter backup value | |
virtual void | flush () |
copy backup value into current value | |
const math::Vector< real > & | operator= (const math::Vector< real > &pValues) throw (FlockException) |
parameter = vector | |
const math::Vector< real > & | operator+= (const math::Vector< real > &pValues) throw (FlockException) |
parameter += vector | |
void | setValue (real pValue) |
set parameter value | |
void | setValues (const math::Vector< real > pValues) throw (FlockException) |
set parameter values | |
void | setValues (unsigned int pValueCount, real *pValues) throw (FlockException) |
set parameter values | |
virtual base::String | info (int pPropagationLevel=0) const |
print parameter information | |
Static Public Attributes | |
static const base::String | sClassName |
class name | |
Protected Member Functions | |
Parameter () | |
default constructor | |
Protected Attributes | |
base::String | mName |
parameter name | |
Agent * | mAgent |
agent this parameter belongs to | |
math::Vector< real > & | mValues |
parameter values | |
math::Vector< real > | mBackupValues |
parameter backup values | |
data::IndexHash< base::String, Parameter > | mNeighborLists |
neighbor lists | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const Parameter &pParameter) |
retrieve textual parameter info |
Created by Daniel Bisig on 3/23/07. Copyright 2006 Daniel Bisig All rights reserved.
Parameter::Parameter | ( | Agent * | pAgent, | |
const base::String & | pName, | |||
unsigned int | pDim | |||
) |
create parameter
pAgent | agent this parameter belongs to | |
pName | parameter name | |
pDim | dimension of parameter (> 0) |
Parameter::Parameter | ( | Agent * | pAgent, | |
const base::String & | pName, | |||
const math::Vector< real > & | pValues | |||
) |
create parameter
pAgent | agent this parameter belongs to | |
pName | parameter name | |
pValues | parameter values |
copy constructor
pAgent | agent this parameter belongs to | |
pParameter | parameter to copy |
Parameter::~Parameter | ( | ) | [virtual] |
destructor
Parameter::Parameter | ( | ) | [protected] |
default constructor
const base::String & Parameter::name | ( | ) | const |
return name
unsigned int Parameter::count | ( | ) | const [virtual] |
returns expected number of values
void Parameter::set | ( | real | pValue | ) | [virtual] |
void Parameter::set | ( | unsigned int | pValueCount, | |
const real * | pValues | |||
) | throw (FlockException) [virtual] |
set values
pValueCount | number of values | |
pValues | values |
FlockException | number of values cannot be changed |
void Parameter::set | ( | const math::Vector< real > | pValues | ) | throw (FlockException) [virtual] |
void Parameter::change | ( | real | pValue | ) | [virtual] |
change values
pValue | single value |
void Parameter::change | ( | unsigned int | pValueCount, | |
real * | pValues | |||
) | throw (FlockException) [virtual] |
change values
pValueCount | number of values | |
pValues | values |
FlockException | number of values cannot be changed |
void Parameter::change | ( | const math::Vector< real > | pValues | ) | throw (FlockException) [virtual] |
change values
pValues | values |
FlockException | number of values cannot be changed |
randomize parameter value
pMinParameterValue | minimum parameter value | |
pMaxParameterValue | minimum parameter value |
Reimplemented in iso::flock::EnvParameter.
void Parameter::randomize | ( | const math::Vector< real > & | pMinParameterValues, | |
const math::Vector< real > & | pMaxParameterValues | |||
) | throw (FlockException) [virtual] |
randomize parameter value
pMinParameterValues | minimum parameter values | |
pMaxParameterValues | minimum parameter values |
Reimplemented in iso::flock::EnvParameter.
Agent * Parameter::agent | ( | ) |
return agent this parameter belongs to
math::Vector< flock::real > & Parameter::values | ( | ) |
return parameter values
const math::Vector< flock::real > & Parameter::values | ( | ) | const |
return parameter values
flock::real & Parameter::value | ( | unsigned int | pIndex = 0 |
) | throw (FlockException) |
return parameter value
pIndex | value index |
FlockException | index out of bounds |
math::Vector< flock::real > & Parameter::backupValues | ( | ) |
return parameter backup values
flock::real & Parameter::backupValue | ( | unsigned int | pIndex = 0 |
) | throw (FlockException) |
return parameter backup value
pIndex | backup value index |
FlockException | index out of bounds |
void Parameter::flush | ( | ) | [virtual] |
const math::Vector< flock::real > & Parameter::operator= | ( | const math::Vector< real > & | pValues | ) | throw (FlockException) |
parameter = vector
pValues | vector to copy values from |
FlockException | dimension mismatch |
const math::Vector< flock::real > & Parameter::operator+= | ( | const math::Vector< real > & | pValues | ) | throw (FlockException) |
parameter += vector
pValues | vector to add values from |
FlockException | dimension mismatch |
void Parameter::setValue | ( | real | pValue | ) |
set parameter value
pValue | parameter value |
void Parameter::setValues | ( | const math::Vector< real > | pValues | ) | throw (FlockException) |
set parameter values
pValues | parameter values |
FlockException | dimension mismatch |
void Parameter::setValues | ( | unsigned int | pValueCount, | |
real * | pValues | |||
) | throw (FlockException) |
set parameter values
pValueCount | value count | |
pValues | parameter values |
FlockException | dimension mismatch |
base::String Parameter::info | ( | int | pPropagationLevel = 0 |
) | const [virtual] |
print parameter information
pPropagationLevel | how far the propagation method proceeds through composite classes (-1: unlimited, 0: no proceeding, >0: limited proceeding) |
Reimplemented in iso::flock::EnvParameter.
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Parameter & | pParameter | |||
) | [friend] |
retrieve textual parameter info
pOstream | output text stream | |
pParameter | parameter |
const base::String Parameter::sClassName [static] |
class name
base::String iso::flock::Parameter::mName [protected] |
parameter name
Agent* iso::flock::Parameter::mAgent [protected] |
agent this parameter belongs to
math::Vector<real>& iso::flock::Parameter::mValues [protected] |
parameter values
math::Vector<real> iso::flock::Parameter::mBackupValues [protected] |
parameter backup values
parameter backup values are required for correctly updating parameter values
data::IndexHash<base::String, Parameter> iso::flock::Parameter::mNeighborLists [protected] |
neighbor lists