iso::flock::Simulation Class Reference

#include <iso_flock_simulation.h>

Collaboration diagram for iso::flock::Simulation:

Collaboration graph
[legend]
List of all members.

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
EventManagerevent ()
 return event manager
space::SpaceManager & space ()
 return space manager
FlockComcom ()
 return communcation manager
FlockStatsstats ()
 return analyzer manager
unsigned int agentCount () const
 return agent count
QVector< Agent * > & agents ()
 return agents
Agentagent (unsigned int pIndex) throw (FlockException)
 return agent
Agentagent (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
Swarmswarm (unsigned int pIndex) throw (FlockException)
 return swarm
Swarmswarm (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
Envenv (unsigned int pIndex) throw (FlockException)
 return environment
Envenv (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 Simulationinit (real pUpdateInterval) throw (FlockException)
 init simulation
static Simulationget () 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 SimulationsSimulation

Constructor & Destructor Documentation

Simulation::Simulation (  )  [protected]

default contructor

Simulation::Simulation ( real  pUpdateInterval  )  [protected]

create simulation

Parameters:
pUpdateInterval update interval in milisecs

Simulation::~Simulation (  )  [protected]

destructor


Member Function Documentation

Simulation & Simulation::init ( real  pUpdateInterval  )  throw (FlockException) [static]

init simulation

Parameters:
pUpdateInterval update interval in milisecs
Returns:
simulation
Exceptions:
FlockException simulation already initialized

Simulation & Simulation::get (  )  throw (FlockException) [static]

get simulation singleton instance

Returns:
simulation
Exceptions:
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

Returns:
simulation update rate (simulation steps / sec)

flock::real Simulation::updateInterval (  )  const

return update interval

Returns:
update interval

void Simulation::setUpdateInterval ( real  pUpdateInterval  ) 

set update interval

Parameters:
pUpdateInterval update interval in milisecs

event::EventManager& iso::flock::Simulation::eventManager (  ) 

return event manager

Returns:
event manager

EventManager & Simulation::event (  ) 

return event manager

Returns:
event manager

space::SpaceManager & Simulation::space (  ) 

return space manager

Returns:
space manager

FlockCom & Simulation::com (  ) 

return communcation manager

FlockStats & Simulation::stats (  ) 

return analyzer manager

unsigned int Simulation::agentCount (  )  const

return agent count

Returns:
agent count

QVector< Agent * > & Simulation::agents (  ) 

return agents

Returns:
agents

Agent * Simulation::agent ( unsigned int  pIndex  )  throw (FlockException)

return agent

Parameters:
pIndex agent index
Returns:
agent
Exceptions:
FlockException agent not found

Agent * Simulation::agent ( base::String &  pName  )  throw (FlockException)

return agent

Parameters:
pName agent name
Returns:
agent
Exceptions:
FlockException agent not found

void Simulation::addAgent ( Agent pAgent  ) 

add agent to simulation

Parameters:
pAgent agent

void Simulation::removeAgent ( Agent pAgent  )  throw (FlockException)

remove agent from simulation

Parameters:
pAgent agent
Exceptions:
FlockException failed to remove agent

bool Simulation::checkSwarm ( base::String  pName  ) 

check swarm

Parameters:
pName swarm name
Returns:
true if swarm exists, false otherwise

QVector< Swarm * > & Simulation::swarms (  ) 

return swarms

Returns:
swarms

Swarm * Simulation::swarm ( unsigned int  pIndex  )  throw (FlockException)

return swarm

Parameters:
pIndex swarm index
Returns:
swarm
Exceptions:
FlockException swarm not found

Swarm * Simulation::swarm ( base::String  pName  )  throw (FlockException)

return swarm

Parameters:
pName swarm name
Returns:
swarm
Exceptions:
FlockException swarm not found

void Simulation::addSwarm ( Swarm pSwarm  ) 

add swarm to simulation

Parameters:
pSwarm swarm

void Simulation::removeSwarm ( Swarm pSwarm  ) 

remove swarm from simulation

Parameters:
pSwarm swarm

bool Simulation::checkEnv ( base::String  pName  ) 

check environment

Parameters:
pName environment name
Returns:
true if environment exists, false otherwise

QVector< Env * > & Simulation::envs (  ) 

return environments

Returns:
environments

Env * Simulation::env ( unsigned int  pIndex  )  throw (FlockException)

return environment

Parameters:
pIndex environment index
Returns:
environment
Exceptions:
FlockException environment not found

Env * Simulation::env ( base::String  pName  )  throw (FlockException)

return environment

Parameters:
pName environment name
Returns:
environment
Exceptions:
FlockException environment not found

void Simulation::addEnv ( Env pEnv  ) 

add environment to simulation

Parameters:
pEnv environment

void Simulation::removeEnv ( Env pEnv  ) 

remove environment from simulation

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

Returns:
true, if simulation is paused, false otherwise

void Simulation::switchPaused (  ) 

switch simulation between paused and non-paused mode

void Simulation::exceptionReport ( const base::Exception &  pException  ) 

report exception

Parameters:
pException exception


Member Data Documentation

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]


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