#include <iso_flock_swarm.h>
Inherits iso::flock::Agent.
Inheritance diagram for iso::flock::Swarm:
Public Member Functions | ||||
Swarm (const base::String &pName) | ||||
create swarm | ||||
Swarm (const base::String &pName, Swarm &pSwarm) | ||||
copy constructor | ||||
~Swarm () | ||||
destructor | ||||
unsigned int | agentCount () const | |||
return number of agents | ||||
QVector< Agent * > & | agents () | |||
return agents | ||||
const QVector< Agent * > & | agents () const | |||
return agents | ||||
void | addAgent () throw (FlockException) | |||
add single agent to swarm
| ||||
void | addAgents (unsigned int pAgentCount) throw (FlockException) | |||
add a number of agents to swarm | ||||
void | removeAgent () throw (FlockException) | |||
remove last agent from swarm
| ||||
void | removeAgent (unsigned int pAgentIndex) throw (FlockException) | |||
remove particular agent from swarm
| ||||
void | removeAgents (unsigned int pAgentCount) throw (FlockException) | |||
remove the last n agents from swarm | ||||
void | removeAgents (unsigned int pAgentIndex, unsigned int pAgentCount) throw (FlockException) | |||
remove agents starting from an agent index pAgentIndex start agent from where agents will be removed | ||||
void | removeAgents () throw (FlockException) | |||
remove all agents from swarm
| ||||
unsigned int | swarmParameterCount () const | |||
return number of swarm parameters the swarm contains | ||||
bool | checkSwarmParameter (const base::String &pSwarmParameterName) const | |||
check if swarm has swarm parameter | ||||
Parameter & | swarmParameter (const base::String &pParameterName) throw (FlockException) | |||
get swarm parameter | ||||
Parameter & | swarmParameter (unsigned int pParameterIndex) throw (FlockException) | |||
get swarm parameter | ||||
Parameter & | parameter (unsigned int pAgentIndex, const base::String &pParameterName) throw (FlockException) | |||
get agent parameter | ||||
Parameter & | parameter (unsigned int pAgentIndex, unsigned int pParameterIndex) throw (FlockException) | |||
get agent parameter | ||||
Parameter & | agentParameter (unsigned int pAgentIndex, const base::String &pParameterName) throw (FlockException) | |||
get agent parameter | ||||
Parameter & | agentParameter (unsigned int pAgentIndex, unsigned int pParameterIndex) throw (FlockException) | |||
get agent parameter | ||||
void | addParameter (Parameter *pParameter) throw (FlockException) | |||
add agent parameter | ||||
void | addAgentParameter (Parameter *pParameter) throw (FlockException) | |||
add agent parameter | ||||
void | addSwarmParameter (Parameter *pParameter) throw (FlockException) | |||
add swarm parameter | ||||
void | addParameter (const base::String &pName, unsigned int pDim) throw (FlockException) | |||
create agent parameter | ||||
void | addAgentParameter (const base::String &pName, unsigned int pDim) throw (FlockException) | |||
create agent parameter | ||||
void | addSwarmParameter (const base::String &pName, unsigned int pDim) throw (FlockException) | |||
create swarm parameter | ||||
void | addParameter (const base::String &pName, unsigned int pDim, real pValue) throw (FlockException) | |||
create agent parameter | ||||
void | addAgentParameter (const base::String &pName, unsigned int pDim, real pValue) throw (FlockException) | |||
create agent parameter | ||||
void | addSwarmParameter (const base::String &pName, unsigned int pDim, real pValue) throw (FlockException) | |||
create swarm parameter | ||||
void | addParameter (const base::String &pName, const math::Vector< real > &pValues) throw (FlockException) | |||
create agent parameter | ||||
void | addAgentParameter (const base::String &pName, const math::Vector< real > &pValues) throw (FlockException) | |||
create agent parameter | ||||
void | addSwarmParameter (const base::String &pName, const math::Vector< real > &pValues) throw (FlockException) | |||
create swarm parameter | ||||
void | removeParameter (const base::String pName) throw (FlockException) | |||
remove agent parameter | ||||
void | removeAgentParameter (const base::String pName) throw (FlockException) | |||
remove agent parameter | ||||
void | removeSwarmParameter (const base::String pName) throw (FlockException) | |||
remove agent parameter | ||||
void | set (const base::String &pParameterName, real pParameterValue) throw (FlockException) | |||
set parameter values | ||||
void | set (unsigned int pAgentIndex, const base::String &pParameterName, real pParameterValue) throw (FlockException) | |||
set parameter values | ||||
void | set (const base::String &pParameterName, const math::Vector< real > &pParameterValues) throw (FlockException) | |||
set parameter values | ||||
void | set (unsigned int pAgentIndex, const base::String &pParameterName, const math::Vector< real > &pParameterValues) throw (FlockException) | |||
set parameter values | ||||
void | randomize (const base::String &pParameterName, real pMinParameterValue, real pMaxParameterValue) throw (FlockException) | |||
randomize parameter value | ||||
void | randomize (unsigned int pAgentIndex, const base::String &pParameterName, real pMinParameterValue, real pMaxParameterValue) throw (FlockException) | |||
randomize parameter value | ||||
void | randomize (const base::String &pParameterName, const math::Vector< real > &pMinParameterValues, const math::Vector< real > &pMaxParameterValues) throw (FlockException) | |||
randomize parameter values | ||||
void | randomize (unsigned int pAgentIndex, const base::String &pParameterName, const math::Vector< real > &pMinParameterValues, const math::Vector< real > &pMaxParameterValues) throw (FlockException) | |||
randomize parameter values | ||||
QList< NeighborAssignInfo * > | agentNeighborInfo (const base::String &pParameterName) | |||
QList< NeighborAssignInfo * > | swarmNeighborInfo (const base::String &pParameterName) | |||
void | assignNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, space::NeighborGroupAlg *pNeighborGroupAlg) throw (FlockException) | |||
assign neighbors for an agent and/or swarm parameter | ||||
void | assignAgentNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, space::NeighborGroupAlg *pNeighborGroupAlg) throw (FlockException) | |||
assign neighbors for a agent parameter | ||||
void | assignSwarmNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, space::NeighborGroupAlg *pNeighborGroupAlg) throw (FlockException) | |||
assign neighbors for a swarm parameter | ||||
void | assignNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible) throw (FlockException) | |||
assign neighbors for an agent parameter | ||||
void | assignAgentNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible) throw (FlockException) | |||
assign neighbors for an agent parameter | ||||
void | assignSwarmNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible) throw (FlockException) | |||
assign neighbors for a swarm parameter | ||||
void | assignNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, real pNeighborRadius, int pMaxNeighborCount, bool pReplaceNeighborMode) throw (FlockException) | |||
assign neighbors for an agent parameter | ||||
void | assignAgentNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, real pNeighborRadius, int pMaxNeighborCount, bool pReplaceNeighborMode) throw (FlockException) | |||
assign neighbors for an agent parameter | ||||
void | assignSwarmNeighbors (const base::String &pParameterName, const base::String &pSpaceName, bool pVisible, real pNeighborRadius, int pMaxNeighborCount, bool pReplaceNeighborMode) throw (FlockException) | |||
assign neighbors for a swarm parameter | ||||
void | removeNeighbors (const base::String &pParameterName, const base::String &pSpaceName) throw (FlockException) | |||
remove neighbors for an agent parameter | ||||
void | removeAgentNeighbors (const base::String &pParameterName, const base::String &pSpaceName) throw (FlockException) | |||
remove neighbors for an agent parameter | ||||
void | removeSwarmNeighbors (const base::String &pParameterName, const base::String &pSpaceName) throw (FlockException) | |||
remove neighbors for a swarm parameter | ||||
unsigned int | swarmBehaviorCount () const | |||
return number of swarm behaviors the swarm contains | ||||
bool | checkSwarmBehavior (const base::String &pSwarmBehaviorName) const | |||
check if swarm has swarm behavior | ||||
Behavior & | swarmBehavior (const base::String &pBehaviorName) throw (FlockException) | |||
get swarm behavior | ||||
Behavior & | swarmBehavior (unsigned int pBehaviorIndex) throw (FlockException) | |||
get swarm behavior | ||||
void | addSwarmBehavior (Behavior *pBehavior) throw (FlockException) | |||
add agent behavior add agent behavior add swarm behavior | ||||
void | addBehavior (const base::String &pBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | addBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | addBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | moveBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition) throw (FlockException) | |||
move agent behavior | ||||
void | moveBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName) throw (FlockException) | |||
move agent behavior | ||||
void | addAgentBehavior (const base::String &pBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | addAgentBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | addAgentBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add agent behavior | ||||
void | moveAgentBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition) throw (FlockException) | |||
move agent behavior | ||||
void | moveAgentBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName) throw (FlockException) | |||
move agent behavior | ||||
void | addSwarmBehavior (const base::String &pBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add swarm behavior | ||||
void | addSwarmBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition, const Behavior &pBehavior) throw (FlockException) | |||
add swarm behavior | ||||
void | addSwarmBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName, const Behavior &pBehavior) throw (FlockException) | |||
add swarm behavior | ||||
void | moveSwarmBehavior (const base::String &pBehaviorName, unsigned int pBehaviorPosition) throw (FlockException) | |||
move swarm behavior | ||||
void | moveSwarmBehavior (const base::String &pBehaviorName, const base::String &pSuccessorBehaviorName) throw (FlockException) | |||
move swarm behavior | ||||
void | removeBehavior (const base::String &pBehaviorName) throw (FlockException) | |||
remove agent behavior | ||||
void | removeAgentBehavior (const base::String &pBehaviorName) throw (FlockException) | |||
remove agent behavior | ||||
void | removeSwarmBehavior (const base::String &pBehaviorName) throw (FlockException) | |||
remove swarm behavior | ||||
virtual void | act () | |||
perform behaviors | ||||
virtual void | flush () | |||
update parameters | ||||
void | notify () | |||
notify swarm whenever the simulation progresses a step | ||||
virtual base::String | info (int pPropagationLevel=0) const | |||
print swarm information | ||||
Static Public Attributes | ||||
static unsigned int | sInstanceCount | |||
number of agent instances | ||||
Protected Member Functions | ||||
Swarm () | ||||
total number of swarm instances ever created default constructor | ||||
Protected Attributes | ||||
ParameterList & | mAgentParameterList | |||
BehaviorList & | mAgentBehaviorList | |||
list of agent parameters | ||||
ParameterList | mSwarmParameterList | |||
list of agent behaviors | ||||
BehaviorList | mSwarmBehaviorList | |||
swarm exclusive list of parameters | ||||
QVector< Agent * > | mAgents | |||
swarm exclusive list of behaviors | ||||
unsigned int | mAgentCreationCount | |||
swarm agents | ||||
QHash< base::String, NeighborAssignInfo * > | mAgentNeighborAssignRegistry | |||
numbers of agents ever created for this swarm | ||||
QHash< base::String, NeighborAssignInfo * > | mSwarmNeighborAssignRegistry | |||
registry for all agent parameters that are assigned to some neighbor space | ||||
Friends | ||||
std::ostream & | operator<< (std::ostream &pOstream, const Swarm &pSwarm) | |||
print swarm information |
Swarm::Swarm | ( | const base::String & | pName | ) |
create swarm
pName | swarm name |
Swarm::Swarm | ( | const base::String & | pName, | |
Swarm & | pSwarm | |||
) |
copy constructor
pName | swarm name | |
pSwarm | swarm to copy from |
Swarm::~Swarm | ( | ) |
destructor
Swarm::Swarm | ( | ) | [protected] |
total number of swarm instances ever created default constructor
unsigned int Swarm::agentCount | ( | ) | const |
return number of agents
QVector< Agent * > & Swarm::agents | ( | ) |
return agents
const QVector< Agent * > & Swarm::agents | ( | ) | const |
return agents
void Swarm::addAgent | ( | ) | throw (FlockException) |
void Swarm::addAgents | ( | unsigned int | pAgentCount | ) | throw (FlockException) |
add a number of agents to swarm
pAgentCount | number of agents to add |
FlockException | failed to add agents |
void Swarm::removeAgent | ( | ) | throw (FlockException) |
void Swarm::removeAgent | ( | unsigned int | pAgentIndex | ) | throw (FlockException) |
void Swarm::removeAgents | ( | unsigned int | pAgentCount | ) | throw (FlockException) |
remove the last n agents from swarm
pAgentCount | number of agents to remove |
FlockException | failed to remove agents |
void Swarm::removeAgents | ( | unsigned int | pAgentIndex, | |
unsigned int | pAgentCount | |||
) | throw (FlockException) |
remove agents starting from an agent index pAgentIndex start agent from where agents will be removed
pAgentCount | number of agents to remove |
FlockException | failed to remove agents |
void Swarm::removeAgents | ( | ) | throw (FlockException) |
unsigned int Swarm::swarmParameterCount | ( | ) | const |
return number of swarm parameters the swarm contains
bool Swarm::checkSwarmParameter | ( | const base::String & | pSwarmParameterName | ) | const |
check if swarm has swarm parameter
pSwarmParameterName | swarm parameter name |
Parameter & Swarm::swarmParameter | ( | const base::String & | pParameterName | ) | throw (FlockException) |
get swarm parameter
pParameterName | swarm parameter name |
FlockException | swarm parameter does not exist |
Parameter & Swarm::swarmParameter | ( | unsigned int | pParameterIndex | ) | throw (FlockException) |
get swarm parameter
pParameterIndex | swarm parameter index |
FlockException | swarm parameter does not exist |
Parameter & Swarm::parameter | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName | |||
) | throw (FlockException) |
get agent parameter
pAgentIndex | agent index | |
pParameterName | agent parameter name |
FlockException | agent does not exist or agent parameter does not exist |
Parameter & Swarm::parameter | ( | unsigned int | pAgentIndex, | |
unsigned int | pParameterIndex | |||
) | throw (FlockException) |
get agent parameter
pAgentIndex | agent index | |
pParameterIndex | agent parameter index |
FlockException | agent does not exist or agent parameter does not exist |
Parameter & Swarm::agentParameter | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName | |||
) | throw (FlockException) |
get agent parameter
pAgentIndex | agent index | |
pParameterName | agent parameter name |
FlockException | agent does not exist or agent parameter does not exist |
Parameter & Swarm::agentParameter | ( | unsigned int | pAgentIndex, | |
unsigned int | pParameterIndex | |||
) | throw (FlockException) |
get agent parameter
pAgentIndex | agent index | |
pParameterIndex | agent parameter index |
FlockException | agent does not exist or agent parameter does not exist |
void Swarm::addParameter | ( | Parameter * | pParameter | ) | throw (FlockException) [virtual] |
add agent parameter
pParameter | agent parameter |
FlockException | agent parameter name already exists |
Reimplemented from iso::flock::Agent.
void Swarm::addAgentParameter | ( | Parameter * | pParameter | ) | throw (FlockException) |
add agent parameter
pParameter | agent parameter |
FlockException | agent parameter name already exists |
void Swarm::addSwarmParameter | ( | Parameter * | pParameter | ) | throw (FlockException) |
add swarm parameter
pParameter | swarm parameter |
FlockException | swarm parameter name already exists |
void Swarm::addParameter | ( | const base::String & | pName, | |
unsigned int | pDim | |||
) | throw (FlockException) [virtual] |
create agent parameter
pName | agent parameter name | |
pDim | dimension of agent parameter (> 0) |
FlockException | agent parameter name already exists |
Reimplemented from iso::flock::Agent.
void Swarm::addAgentParameter | ( | const base::String & | pName, | |
unsigned int | pDim | |||
) | throw (FlockException) |
create agent parameter
pName | agent parameter name | |
pDim | dimension of agent parameter (> 0) |
FlockException | agent parameter name already exists |
void Swarm::addSwarmParameter | ( | const base::String & | pName, | |
unsigned int | pDim | |||
) | throw (FlockException) |
create swarm parameter
pName | swarm parameter name | |
pDim | dimension of swarm parameter (> 0) |
FlockException | swarm parameter name already exists |
void Swarm::addParameter | ( | const base::String & | pName, | |
unsigned int | pDim, | |||
real | pValue | |||
) | throw (FlockException) [virtual] |
create agent parameter
pName | agent parameter name | |
pDim | dimension of agent parameter (> 0) | |
pValue | uniform agent parameter value |
FlockException | agent parameter name already exists |
Reimplemented from iso::flock::Agent.
void Swarm::addAgentParameter | ( | const base::String & | pName, | |
unsigned int | pDim, | |||
real | pValue | |||
) | throw (FlockException) |
create agent parameter
pName | agent parameter name | |
pDim | dimension of agent parameter (> 0) | |
pValue | uniform agent parameter value |
FlockException | agent parameter name already exists |
void Swarm::addSwarmParameter | ( | const base::String & | pName, | |
unsigned int | pDim, | |||
real | pValue | |||
) | throw (FlockException) |
create swarm parameter
pName | swarm parameter name | |
pDim | dimension of swarm parameter (> 0) | |
pValue | uniform swarm parameter value |
FlockException | swarm parameter name already exists |
void Swarm::addParameter | ( | const base::String & | pName, | |
const math::Vector< real > & | pValues | |||
) | throw (FlockException) [virtual] |
create agent parameter
pName | agent parameter name | |
pValues | agent parameter values |
FlockException | agent parameter name already exists |
Reimplemented from iso::flock::Agent.
void Swarm::addAgentParameter | ( | const base::String & | pName, | |
const math::Vector< real > & | pValues | |||
) | throw (FlockException) |
create agent parameter
pName | agent parameter name | |
pValues | agent parameter values |
FlockException | agent parameter name already exists |
void Swarm::addSwarmParameter | ( | const base::String & | pName, | |
const math::Vector< real > & | pValues | |||
) | throw (FlockException) |
create swarm parameter
pName | swarm parameter name | |
pValues | swarm parameter values |
FlockException | swarm parameter name already exists |
void Swarm::removeParameter | ( | const base::String | pName | ) | throw (FlockException) |
remove agent parameter
pName | agent parameter |
failed | to remove agent parameter |
void Swarm::removeAgentParameter | ( | const base::String | pName | ) | throw (FlockException) |
remove agent parameter
pName | agent parameter |
failed | to remove agent parameter |
void Swarm::removeSwarmParameter | ( | const base::String | pName | ) | throw (FlockException) |
remove agent parameter
pName | agent parameter |
failed | to remove agent parameter |
void Swarm::set | ( | const base::String & | pParameterName, | |
real | pParameterValue | |||
) | throw (FlockException) [virtual] |
set parameter values
pParameterName | parameter name | |
pParameterValue | parameter value |
FlockException | parameter name is not found |
Reimplemented from iso::flock::Agent.
void Swarm::set | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName, | |||
real | pParameterValue | |||
) | throw (FlockException) |
set parameter values
pAgentIndex | agent index | |
pParameterName | parameter name | |
pParameterValue | parameter value |
FlockException | agent index out of bounds or parameter name is not found |
void Swarm::set | ( | const base::String & | pParameterName, | |
const math::Vector< real > & | pParameterValues | |||
) | throw (FlockException) [virtual] |
set parameter values
pParameterName | parameter name | |
pParameterValues | parameter values |
FlockException | parameter name is not found or parameter values has wrong dimension |
Reimplemented from iso::flock::Agent.
void Swarm::set | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName, | |||
const math::Vector< real > & | pParameterValues | |||
) | throw (FlockException) |
set parameter values
pAgentIndex | agent index | |
pParameterName | parameter name | |
pParameterValues | parameter values |
FlockException | agent index out of bounds or parameter name is not found |
void Swarm::randomize | ( | const base::String & | pParameterName, | |
real | pMinParameterValue, | |||
real | pMaxParameterValue | |||
) | throw (FlockException) [virtual] |
randomize parameter value
pParameterName | parameter name | |
pMinParameterValue | minimum parameter value | |
pMaxParameterValue | maximum parameter value |
FlockException | parameter name not found |
Reimplemented from iso::flock::Agent.
void Swarm::randomize | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName, | |||
real | pMinParameterValue, | |||
real | pMaxParameterValue | |||
) | throw (FlockException) |
randomize parameter value
pAgentIndex | agent index | |
pParameterName | parameter name | |
pMinParameterValue | minimum parameter value | |
pMaxParameterValue | maximum parameter value |
FlockException | agent index out of bounds or parameter name is not found |
void Swarm::randomize | ( | const base::String & | pParameterName, | |
const math::Vector< real > & | pMinParameterValues, | |||
const math::Vector< real > & | pMaxParameterValues | |||
) | throw (FlockException) [virtual] |
randomize parameter values
pParameterName | parameter name | |
pMinParameterValues | minimum parameter values | |
pMaxParameterValues | maximum parameter values |
FlockException | parameter name not found or parameter values has wrong dimension |
Reimplemented from iso::flock::Agent.
void Swarm::randomize | ( | unsigned int | pAgentIndex, | |
const base::String & | pParameterName, | |||
const math::Vector< real > & | pMinParameterValues, | |||
const math::Vector< real > & | pMaxParameterValues | |||
) | throw (FlockException) |
randomize parameter values
pAgentIndex | agent index | |
pParameterName | parameter name | |
pMinParameterValues | minimum parameter values | |
pMaxParameterValues | maximum parameter values |
FlockException | agent index out of bounds, parameter name not found or parameter values has wrong dimension |
QList< NeighborAssignInfo * > Swarm::agentNeighborInfo | ( | const base::String & | pParameterName | ) |
QList< NeighborAssignInfo * > Swarm::swarmNeighborInfo | ( | const base::String & | pParameterName | ) |
void Swarm::assignNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
space::NeighborGroupAlg * | pNeighborGroupAlg | |||
) | throw (FlockException) [virtual] |
assign neighbors for an agent and/or swarm parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborGroupAlg | neighbor group algorithm |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
Reimplemented from iso::flock::Agent.
void Swarm::assignAgentNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
space::NeighborGroupAlg * | pNeighborGroupAlg | |||
) | throw (FlockException) |
assign neighbors for a agent parameter
pParameterName | agent parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborGroupAlg | neighbor group algorithm |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::assignSwarmNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
space::NeighborGroupAlg * | pNeighborGroupAlg | |||
) | throw (FlockException) |
assign neighbors for a swarm parameter
pParameterName | swarm parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborGroupAlg | neighbor group algorithm |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::assignNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible | |||
) | throw (FlockException) [virtual] |
assign neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
Reimplemented from iso::flock::Agent.
void Swarm::assignAgentNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible | |||
) | throw (FlockException) |
assign neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::assignSwarmNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible | |||
) | throw (FlockException) |
assign neighbors for a swarm parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::assignNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
real | pNeighborRadius, | |||
int | pMaxNeighborCount, | |||
bool | pReplaceNeighborMode | |||
) | throw (FlockException) [virtual] |
assign neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborRadius | radius within which neighbors are searched | |
pMaxNeighborCount | maximum number of neighbors in neighbor list if >= 0 (-1: no limit) | |
pReplaceNeighborMode | replace more distant neighbors with closer neighbors if true |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
Reimplemented from iso::flock::Agent.
void Swarm::assignAgentNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
real | pNeighborRadius, | |||
int | pMaxNeighborCount, | |||
bool | pReplaceNeighborMode | |||
) | throw (FlockException) |
assign neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborRadius | radius within which neighbors are searched | |
pMaxNeighborCount | maximum number of neighbors in neighbor list if >= 0 (-1: no limit) | |
pReplaceNeighborMode | replace more distant neighbors with closer neighbors if true |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::assignSwarmNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName, | |||
bool | pVisible, | |||
real | pNeighborRadius, | |||
int | pMaxNeighborCount, | |||
bool | pReplaceNeighborMode | |||
) | throw (FlockException) |
assign neighbors for a swarm parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space | |
pVisible | whether parameter is visible | |
pNeighborRadius | radius within which neighbors are searched | |
pMaxNeighborCount | maximum number of neighbors in neighbor list if >= 0 (-1: no limit) | |
pReplaceNeighborMode | replace more distant neighbors with closer neighbors if true |
FlockException | parameter not found, space not found, parameter and space dimension mismatch |
void Swarm::removeNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName | |||
) | throw (FlockException) |
remove neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space |
FlockException | parameter not found, space not found |
void Swarm::removeAgentNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName | |||
) | throw (FlockException) |
remove neighbors for an agent parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space |
FlockException | parameter not found, space not found |
void Swarm::removeSwarmNeighbors | ( | const base::String & | pParameterName, | |
const base::String & | pSpaceName | |||
) | throw (FlockException) |
remove neighbors for a swarm parameter
pParameterName | parameter name | |
pSpaceName | name of neighbor space |
FlockException | parameter not found, space not found |
unsigned int Swarm::swarmBehaviorCount | ( | ) | const |
return number of swarm behaviors the swarm contains
bool Swarm::checkSwarmBehavior | ( | const base::String & | pSwarmBehaviorName | ) | const |
check if swarm has swarm behavior
pSwarmBehaviorName | swarm behavior name |
Behavior & Swarm::swarmBehavior | ( | const base::String & | pBehaviorName | ) | throw (FlockException) |
get swarm behavior
pBehaviorName | swarm behavior name |
FlockException | swarm behavior does not exist |
Behavior & Swarm::swarmBehavior | ( | unsigned int | pBehaviorIndex | ) | throw (FlockException) |
get swarm behavior
pBehaviorIndex | swarm behavior index |
FlockException | swarm behavior does not exist |
void Swarm::addSwarmBehavior | ( | Behavior * | pBehavior | ) | throw (FlockException) |
add agent behavior add agent behavior add swarm behavior
pBehavior | swarm behavior |
FlockException | swarm behavior already exists |
void Swarm::addBehavior | ( | const base::String & | pBehaviorName, | |
const Behavior & | pBehavior | |||
) | throw (FlockException) [virtual] |
add agent behavior
pBehaviorName | behavior name | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
Reimplemented from iso::flock::Agent.
void Swarm::addBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) [virtual] |
add agent behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
Reimplemented from iso::flock::Agent.
void Swarm::addBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) [virtual] |
add agent behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
Reimplemented from iso::flock::Agent.
void Swarm::moveBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition | |||
) | throw (FlockException) [virtual] |
move agent behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position |
FlockException | behavior not found |
Reimplemented from iso::flock::Agent.
void Swarm::moveBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName | |||
) | throw (FlockException) [virtual] |
move agent behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted |
FlockException | behavior not found |
Reimplemented from iso::flock::Agent.
void Swarm::addAgentBehavior | ( | const base::String & | pBehaviorName, | |
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add agent behavior
pBehaviorName | agent behavior name | |
pBehavior | agent behavior |
FlockException | agent behavior already exists or Illegal Behavior Parameters |
void Swarm::addAgentBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add agent behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
void Swarm::addAgentBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add agent behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
void Swarm::moveAgentBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition | |||
) | throw (FlockException) |
move agent behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position |
FlockException | behavior not found |
void Swarm::moveAgentBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName | |||
) | throw (FlockException) |
move agent behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted |
FlockException | behavior not found |
void Swarm::addSwarmBehavior | ( | const base::String & | pBehaviorName, | |
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add swarm behavior
pBehaviorName | swarm behavior name | |
pBehavior | swarm behavior |
FlockException | swarm behavior already exists or Illegal Behavior Parameters |
void Swarm::addSwarmBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add swarm behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
void Swarm::addSwarmBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName, | |||
const Behavior & | pBehavior | |||
) | throw (FlockException) |
add swarm behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted | |
pBehavior | behavior |
FlockException | behavior already exists or Illegal Behavior Parameters |
void Swarm::moveSwarmBehavior | ( | const base::String & | pBehaviorName, | |
unsigned int | pBehaviorPosition | |||
) | throw (FlockException) |
move swarm behavior
pBehaviorName | behavior name | |
pBehaviorPosition | behavior position |
FlockException | behavior not found |
void Swarm::moveSwarmBehavior | ( | const base::String & | pBehaviorName, | |
const base::String & | pSuccessorBehaviorName | |||
) | throw (FlockException) |
move swarm behavior
pBehaviorName | behavior name | |
pSuccessorBehaviorName | name of behavior in front of which the new behavior is inserted |
FlockException | behavior not found |
void Swarm::removeBehavior | ( | const base::String & | pBehaviorName | ) | throw (FlockException) [virtual] |
remove agent behavior
pBehaviorName | agent behavior name |
FlockException | failed to remove agent behavior |
Reimplemented from iso::flock::Agent.
void Swarm::removeAgentBehavior | ( | const base::String & | pBehaviorName | ) | throw (FlockException) |
remove agent behavior
pBehaviorName | agent behavior name |
FlockException | failed to remove agent behavior |
void Swarm::removeSwarmBehavior | ( | const base::String & | pBehaviorName | ) | throw (FlockException) |
remove swarm behavior
pBehaviorName | swarm behavior name |
FlockException | failed to remove swarm behavior |
void Swarm::act | ( | ) | [virtual] |
void Swarm::flush | ( | ) | [virtual] |
void Swarm::notify | ( | ) |
notify swarm whenever the simulation progresses a step
base::String Swarm::info | ( | int | pPropagationLevel = 0 |
) | const [virtual] |
print swarm information
pPropagationLevel | how far the propagation method proceeds through composite classes (-1: unlimited, 0: no proceeding, >0: limited proceeding) |
Reimplemented from iso::flock::Agent.
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const Swarm & | pSwarm | |||
) | [friend] |
print swarm information
unsigned int Swarm::sInstanceCount [static] |
ParameterList& iso::flock::Swarm::mAgentParameterList [protected] |
BehaviorList& iso::flock::Swarm::mAgentBehaviorList [protected] |
list of agent parameters
ParameterList iso::flock::Swarm::mSwarmParameterList [protected] |
list of agent behaviors
BehaviorList iso::flock::Swarm::mSwarmBehaviorList [protected] |
swarm exclusive list of parameters
QVector<Agent*> iso::flock::Swarm::mAgents [protected] |
swarm exclusive list of behaviors
unsigned int iso::flock::Swarm::mAgentCreationCount [protected] |
swarm agents
QHash< base::String, NeighborAssignInfo* > iso::flock::Swarm::mAgentNeighborAssignRegistry [protected] |
numbers of agents ever created for this swarm
QHash< base::String, NeighborAssignInfo* > iso::flock::Swarm::mSwarmNeighborAssignRegistry [protected] |
registry for all agent parameters that are assigned to some neighbor space