iso::flock::Parameter Class Reference

parameter class More...

#include <iso_flock_parameter.h>

Inherited by iso::flock::EnvParameter.

Inheritance diagram for iso::flock::Parameter:

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

Collaboration graph
[legend]
List of all members.

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
Agentagent ()
 return agent this parameter belongs to
math::Vector< real > & values ()
 return parameter values
const math::Vector< real > & values () const
 return parameter values
realvalue (unsigned int pIndex=0) throw (FlockException)
 return parameter value
math::Vector< real > & backupValues ()
 return parameter backup values
realbackupValue (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
AgentmAgent
 agent this parameter belongs to
math::Vector< real > & mValues
 parameter values
math::Vector< realmBackupValues
 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

Detailed Description

parameter class

Created by Daniel Bisig on 3/23/07. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

Parameter::Parameter ( Agent pAgent,
const base::String &  pName,
unsigned int  pDim 
)

create parameter

Parameters:
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

Parameters:
pAgent agent this parameter belongs to
pName parameter name
pValues parameter values

Parameter::Parameter ( Agent pAgent,
Parameter pParameter 
)

copy constructor

Parameters:
pAgent agent this parameter belongs to
pParameter parameter to copy

Parameter::~Parameter (  )  [virtual]

destructor

Parameter::Parameter (  )  [protected]

default constructor


Member Function Documentation

const base::String & Parameter::name (  )  const

return name

Returns:
name

unsigned int Parameter::count (  )  const [virtual]

returns expected number of values

Returns:
expected number of values

void Parameter::set ( real  pValue  )  [virtual]

set values

Parameters:
pValue single value

Reimplemented in iso::flock::EnvParameter.

void Parameter::set ( unsigned int  pValueCount,
const real pValues 
) throw (FlockException) [virtual]

set values

Parameters:
pValueCount number of values
pValues values
Exceptions:
FlockException number of values cannot be changed

void Parameter::set ( const math::Vector< real pValues  )  throw (FlockException) [virtual]

set values

Parameters:
pValues values
Exceptions:
FlockException number of values cannot be changed

void Parameter::change ( real  pValue  )  [virtual]

change values

Parameters:
pValue single value

void Parameter::change ( unsigned int  pValueCount,
real pValues 
) throw (FlockException) [virtual]

change values

Parameters:
pValueCount number of values
pValues values
Exceptions:
FlockException number of values cannot be changed

void Parameter::change ( const math::Vector< real pValues  )  throw (FlockException) [virtual]

change values

Parameters:
pValues values
Exceptions:
FlockException number of values cannot be changed

void Parameter::randomize ( real  pMinParameterValue,
real  pMaxParameterValue 
) [virtual]

randomize parameter value

Parameters:
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

Parameters:
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

Returns:
parameter values

const math::Vector< flock::real > & Parameter::values (  )  const

return parameter values

Returns:
parameter values

flock::real & Parameter::value ( unsigned int  pIndex = 0  )  throw (FlockException)

return parameter value

Parameters:
pIndex value index
Returns:
parameter value
Exceptions:
FlockException index out of bounds

math::Vector< flock::real > & Parameter::backupValues (  ) 

return parameter backup values

Returns:
parameter backup values

flock::real & Parameter::backupValue ( unsigned int  pIndex = 0  )  throw (FlockException)

return parameter backup value

Parameters:
pIndex backup value index
Returns:
parameter backup value
Exceptions:
FlockException index out of bounds

void Parameter::flush (  )  [virtual]

copy backup value into current value

Reimplemented in iso::flock::EnvParameter.

const math::Vector< flock::real > & Parameter::operator= ( const math::Vector< real > &  pValues  )  throw (FlockException)

parameter = vector

Parameters:
pValues vector to copy values from
Returns:
Vector
Exceptions:
FlockException dimension mismatch
copy vector values to backup values

const math::Vector< flock::real > & Parameter::operator+= ( const math::Vector< real > &  pValues  )  throw (FlockException)

parameter += vector

Parameters:
pValues vector to add values from
Returns:
Vector
Exceptions:
FlockException dimension mismatch
add vector values to backup values

void Parameter::setValue ( real  pValue  ) 

set parameter value

Parameters:
pValue parameter value
sets both value and backup value

void Parameter::setValues ( const math::Vector< real pValues  )  throw (FlockException)

set parameter values

Parameters:
pValues parameter values
Exceptions:
FlockException dimension mismatch
sets both values and backup values

void Parameter::setValues ( unsigned int  pValueCount,
real pValues 
) throw (FlockException)

set parameter values

Parameters:
pValueCount value count
pValues parameter values
Exceptions:
FlockException dimension mismatch
sets both values and backup values

base::String Parameter::info ( int  pPropagationLevel = 0  )  const [virtual]

print parameter information

Parameters:
pPropagationLevel how far the propagation method proceeds through composite classes (-1: unlimited, 0: no proceeding, >0: limited proceeding)

Reimplemented in iso::flock::EnvParameter.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const Parameter pParameter 
) [friend]

retrieve textual parameter info

Parameters:
pOstream output text stream
pParameter parameter


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 15:28:04 2011 for iso_flock by  doxygen 1.5.1