#include <iso_flock_simulation.h>
Collaboration diagram for iso::flock::Simulation:
Public Member Functions | |
long | simulationStep () const |
return simulation step | |
real | updateRate () const |
return simulation update rate | |
real | updateInterval () const |
return update interval | |
void | setUpdateInterval (real pUpdateInterval) |
set update interval | |
event::EventManager & | eventManager () |
return event manager | |
EventManager & | event () |
return event manager | |
space::SpaceManager & | space () |
return space manager | |
FlockCom & | com () |
return communcation manager | |
FlockStats & | stats () |
return analyzer manager | |
unsigned int | agentCount () const |
return agent count | |
QVector< Agent * > & | agents () |
return agents | |
Agent * | agent (unsigned int pIndex) throw (FlockException) |
return agent | |
Agent * | agent (base::String &pName) throw (FlockException) |
return agent | |
void | addAgent (Agent *pAgent) |
add agent to simulation | |
void | removeAgent (Agent *pAgent) throw (FlockException) |
remove agent from simulation | |
bool | checkSwarm (base::String pName) |
check swarm | |
QVector< Swarm * > & | swarms () |
return swarms | |
Swarm * | swarm (unsigned int pIndex) throw (FlockException) |
return swarm | |
Swarm * | swarm (base::String pName) throw (FlockException) |
return swarm | |
void | addSwarm (Swarm *pSwarm) |
add swarm to simulation | |
void | removeSwarm (Swarm *pSwarm) |
remove swarm from simulation | |
bool | checkEnv (base::String pName) |
check environment | |
QVector< Env * > & | envs () |
return environments | |
Env * | env (unsigned int pIndex) throw (FlockException) |
return environment | |
Env * | env (base::String pName) throw (FlockException) |
return environment | |
void | addEnv (Env *pEnv) |
add environment to simulation | |
void | removeEnv (Env *pEnv) |
remove environment from simulation | |
void | clear () |
clear entire simulation | |
void | update () |
perform one simulation step | |
void | run () |
thread run | |
bool | paused () |
check whether simulation is paused or not | |
void | switchPaused () |
switch simulation between paused and non-paused mode | |
void | exceptionReport (const base::Exception &pException) |
report exception | |
Static Public Member Functions | |
static Simulation & | init (real pUpdateInterval) throw (FlockException) |
init simulation | |
static Simulation & | get () throw (FlockException) |
get simulation singleton instance | |
static void | destroy () |
destroy simulation singleton instance | |
Protected Member Functions | |
Simulation () | |
default contructor | |
Simulation (real pUpdateInterval) | |
create simulation | |
~Simulation () | |
destructor | |
Protected Attributes | |
QVector< Agent * > | mAgents |
singleton instance | |
QVector< Swarm * > | mSwarms |
agents | |
QVector< Env * > | mEnvs |
swarms | |
unsigned int | mUpdateInterval |
environments | |
real | mUpdateRate |
simulation update interval (in microsecs) | |
bool | mTerminated |
simulation update rate | |
QTime | mTime |
simulation termination flag | |
EventManager | mEventManager |
simulation running time | |
long | mSimulationStep |
event manager | |
bool | mPaused |
Static Protected Attributes | |
static Simulation * | sSimulation |
Simulation::Simulation | ( | ) | [protected] |
default contructor
Simulation::Simulation | ( | real | pUpdateInterval | ) | [protected] |
create simulation
pUpdateInterval | update interval in milisecs |
Simulation::~Simulation | ( | ) | [protected] |
destructor
Simulation & Simulation::init | ( | real | pUpdateInterval | ) | throw (FlockException) [static] |
init simulation
pUpdateInterval | update interval in milisecs |
FlockException | simulation already initialized |
Simulation & Simulation::get | ( | ) | throw (FlockException) [static] |
get simulation singleton instance
FlockException | simulation not yet initialized |
void Simulation::destroy | ( | ) | [static] |
destroy simulation singleton instance
long Simulation::simulationStep | ( | ) | const |
return simulation step
flock::real Simulation::updateRate | ( | ) | const |
return simulation update rate
flock::real Simulation::updateInterval | ( | ) | const |
return update interval
void Simulation::setUpdateInterval | ( | real | pUpdateInterval | ) |
set update interval
pUpdateInterval | update interval in milisecs |
event::EventManager& iso::flock::Simulation::eventManager | ( | ) |
return event manager
EventManager & Simulation::event | ( | ) |
return event manager
space::SpaceManager & Simulation::space | ( | ) |
return space manager
FlockCom & Simulation::com | ( | ) |
return communcation manager
FlockStats & Simulation::stats | ( | ) |
return analyzer manager
unsigned int Simulation::agentCount | ( | ) | const |
return agent count
QVector< Agent * > & Simulation::agents | ( | ) |
return agents
Agent * Simulation::agent | ( | unsigned int | pIndex | ) | throw (FlockException) |
return agent
pIndex | agent index |
FlockException | agent not found |
Agent * Simulation::agent | ( | base::String & | pName | ) | throw (FlockException) |
void Simulation::addAgent | ( | Agent * | pAgent | ) |
add agent to simulation
pAgent | agent |
void Simulation::removeAgent | ( | Agent * | pAgent | ) | throw (FlockException) |
remove agent from simulation
pAgent | agent |
FlockException | failed to remove agent |
bool Simulation::checkSwarm | ( | base::String | pName | ) |
check swarm
pName | swarm name |
QVector< Swarm * > & Simulation::swarms | ( | ) |
return swarms
Swarm * Simulation::swarm | ( | unsigned int | pIndex | ) | throw (FlockException) |
return swarm
pIndex | swarm index |
FlockException | swarm not found |
Swarm * Simulation::swarm | ( | base::String | pName | ) | throw (FlockException) |
void Simulation::addSwarm | ( | Swarm * | pSwarm | ) |
add swarm to simulation
pSwarm | swarm |
void Simulation::removeSwarm | ( | Swarm * | pSwarm | ) |
remove swarm from simulation
pSwarm | swarm |
bool Simulation::checkEnv | ( | base::String | pName | ) |
check environment
pName | environment name |
QVector< Env * > & Simulation::envs | ( | ) |
return environments
Env * Simulation::env | ( | unsigned int | pIndex | ) | throw (FlockException) |
return environment
pIndex | environment index |
FlockException | environment not found |
Env * Simulation::env | ( | base::String | pName | ) | throw (FlockException) |
return environment
pName | environment name |
FlockException | environment not found |
void Simulation::addEnv | ( | Env * | pEnv | ) |
add environment to simulation
pEnv | environment |
void Simulation::removeEnv | ( | Env * | pEnv | ) |
remove environment from simulation
pEnv | environment |
void Simulation::clear | ( | ) |
clear entire simulation
void Simulation::update | ( | ) |
perform one simulation step
void Simulation::run | ( | ) |
thread run
bool Simulation::paused | ( | ) |
check whether simulation is paused or not
void Simulation::switchPaused | ( | ) |
switch simulation between paused and non-paused mode
void Simulation::exceptionReport | ( | const base::Exception & | pException | ) |
report exception
pException | exception |
Simulation * Simulation::sSimulation [static, protected] |
QVector<Agent*> iso::flock::Simulation::mAgents [protected] |
singleton instance
QVector<Swarm*> iso::flock::Simulation::mSwarms [protected] |
agents
QVector<Env*> iso::flock::Simulation::mEnvs [protected] |
swarms
unsigned int iso::flock::Simulation::mUpdateInterval [protected] |
environments
real iso::flock::Simulation::mUpdateRate [protected] |
simulation update interval (in microsecs)
bool iso::flock::Simulation::mTerminated [protected] |
simulation update rate
QTime iso::flock::Simulation::mTime [protected] |
simulation termination flag
EventManager iso::flock::Simulation::mEventManager [protected] |
simulation running time
long iso::flock::Simulation::mSimulationStep [protected] |
event manager
bool iso::flock::Simulation::mPaused [protected] |