#include <simulationserver.h>
Inheritance diagram for oxygen::SimulationServer:
Public Types | |
enum | EControlEvent { CE_Init, CE_Done, CE_StartCycle, CE_SenseAgent, CE_ActAgent, CE_EndCycle } |
Public Member Functions | |
SimulationServer () | |
~SimulationServer () | |
virtual float | GetTime () |
returns the current simulation time | |
virtual void | SetSimStep (float deltaTime) |
sets the simulation time step | |
virtual float | GetSimStep () |
returns the simulation time step | |
virtual void | AdvanceTime (float deltaTime) |
increases the accumulated time since the last simulation step, but does not step the simulation | |
virtual float | GetSumDeltaTime () |
returns the accumulated time since the last simulation step | |
bool | InitControlNode (const std::string &className, const std::string &name) |
creates and registers a new SimControlNode to the SimulationServer | |
void | SetAutoTimeMode (bool set) |
sets the auto time mode of the SimulationServer. | |
bool | GetAutoTimeMode () |
returns the current auto time setting | |
boost::shared_ptr< oxygen::SimControlNode > | GetControlNode (const std::string &controlName) |
returns the instance of a registerd SimControlNode | |
int | GetArgC () |
returns the cached argc | |
char ** | GetArgV () |
returns the cached argv | |
virtual void | Run (int argc=0, char **argv=0) |
the runloop of the simulation | |
boost::shared_ptr< MonitorServer > | GetMonitorServer () |
returns the cached MonitorServer reference | |
boost::shared_ptr< GameControlServer > | GetGameControlServer () |
returns the cached GameControlServer reference | |
boost::shared_ptr< SceneServer > | GetSceneServer () |
returns thr cached SceneServer reference | |
int | GetCycle () |
returns the current simulation cycle | |
Static Public Member Functions | |
static void | Quit () |
exits the simulation on the next simulation step | |
Protected Member Functions | |
virtual void | OnLink () |
This method is called, when the hierarchy object has been linked to a parent. | |
virtual void | OnUnlink () |
This rountine is called, before the hierarchy object is removed from the parent. | |
virtual void | Step () |
advances the simulation mSumDeltaTime seconds. | |
void | ControlEvent (EControlEvent event) |
dispatches a ControlEvent to the set of registered SimControlNodes, i.e. | |
Static Protected Member Functions | |
static void | CatchSignal (int sig_num) |
SIGINT handler used to catch ctrl-C. | |
Protected Attributes | |
int | mArgC |
the argc parameter passed to Run() | |
char ** | mArgV |
the argv parameter passed to Run() | |
float | mSimTime |
the current simulation time | |
float | mSimStep |
the discrete simulation time step, or 0 for a non discrete simulation | |
float | mSumDeltaTime |
the accumulated simulation time since the last simulation step | |
bool | mAutoTime |
true if the server automatically advances the simulation time mSimStep every cycle (this is the default), otherwise a SimControlNode is responsible to advance the ime | |
int | mCycle |
the current simulation cycle | |
boost::shared_ptr< MonitorServer > | mMonitorServer |
a cached reference to the monitor server | |
boost::shared_ptr< GameControlServer > | mGameControlServer |
a cached reference to the GameControlServer | |
boost::shared_ptr< SceneServer > | mSceneServer |
a cached reference to the SceneServer | |
Static Protected Attributes | |
static bool | mExit = false |
if true, the simulaion will exit on next simulation step |
Definition at line 34 of file simulationserver.h.
|
Definition at line 43 of file simulationserver.h. |
|
Definition at line 48 of file simulationserver.cpp. References CatchSignal(), mArgC, mArgV, mAutoTime, mCycle, mSimStep, mSimTime, and mSumDeltaTime. Here is the call graph for this function: ![]() |
|
Definition at line 61 of file simulationserver.cpp. |
|
increases the accumulated time since the last simulation step, but does not step the simulation
Definition at line 191 of file simulationserver.cpp. References mSumDeltaTime. Referenced by Run(). |
|
SIGINT handler used to catch ctrl-C.
Definition at line 38 of file simulationserver.cpp. References mExit. Referenced by SimulationServer(). |
|
dispatches a ControlEvent to the set of registered SimControlNodes, i.e. calls a method corresponding to the given event Definition at line 226 of file simulationserver.cpp. References zeitgeist::Node::begin(), CE_ActAgent, CE_Done, CE_EndCycle, CE_Init, CE_SenseAgent, CE_StartCycle, zeitgeist::Node::end(), and zeitgeist::Object::GetLog(). Referenced by Run(). Here is the call graph for this function: ![]() |
|
returns the cached argc
Definition at line 108 of file simulationserver.cpp. References mArgC. |
|
returns the cached argv
Definition at line 113 of file simulationserver.cpp. References mArgV. |
|
returns the current auto time setting
Definition at line 143 of file simulationserver.cpp. References mAutoTime. |
|
returns the instance of a registerd SimControlNode
|
|
returns the current simulation cycle
Definition at line 148 of file simulationserver.cpp. References mCycle. |
|
returns the cached GameControlServer reference
Definition at line 315 of file simulationserver.cpp. References mGameControlServer. |
|
returns the cached MonitorServer reference
Definition at line 320 of file simulationserver.cpp. References mMonitorServer. |
|
returns thr cached SceneServer reference
Definition at line 325 of file simulationserver.cpp. References mSceneServer. |
|
returns the simulation time step
Definition at line 123 of file simulationserver.cpp. References mSimStep. |
|
returns the accumulated time since the last simulation step
Definition at line 133 of file simulationserver.cpp. References mSumDeltaTime. |
|
returns the current simulation time
Definition at line 118 of file simulationserver.cpp. References mSimTime. |
|
creates and registers a new SimControlNode to the SimulationServer
Definition at line 153 of file simulationserver.cpp. References zeitgeist::Node::AddChildReference(), zeitgeist::Object::GetCore(), and zeitgeist::Object::GetLog(). Here is the call graph for this function: ![]() |
|
This method is called, when the hierarchy object has been linked to a parent. At that point, traversal can commence. It can be overridden to support custom 'link' behavior. Reimplemented from zeitgeist::Leaf. Definition at line 65 of file simulationserver.cpp. References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), mGameControlServer, mMonitorServer, and mSceneServer. Here is the call graph for this function: ![]() |
|
This rountine is called, before the hierarchy object is removed from the parent. It can be overridden to support custom 'unlink' behavior. Reimplemented from zeitgeist::Leaf. Definition at line 96 of file simulationserver.cpp. References mGameControlServer, mMonitorServer, and mSceneServer. |
|
exits the simulation on the next simulation step
Definition at line 103 of file simulationserver.cpp. References mExit. |
|
the runloop of the simulation
Definition at line 277 of file simulationserver.cpp. References AdvanceTime(), CE_ActAgent, CE_Done, CE_EndCycle, CE_Init, CE_SenseAgent, CE_StartCycle, ControlEvent(), zeitgeist::Object::GetLog(), mArgC, mArgV, mAutoTime, mCycle, mExit, mSimStep, mSimTime, and Step(). Here is the call graph for this function: ![]() |
|
sets the auto time mode of the SimulationServer. if set to true the SimulationServer automatically advances the simulation mSimStep time every cycle, this is the default mode. Otherwise a registered ControlNode takes the responsibility to do so (by calling AdvanceTime regularly) Definition at line 138 of file simulationserver.cpp. References mAutoTime. |
|
sets the simulation time step
Definition at line 128 of file simulationserver.cpp. References mSimStep. |
|
advances the simulation mSumDeltaTime seconds. If mSimStep is nonzero this is done in discrete steps Definition at line 196 of file simulationserver.cpp. References mGameControlServer, mSceneServer, mSimStep, mSimTime, and mSumDeltaTime. Referenced by Run(). |
|
the argc parameter passed to Run()
Definition at line 141 of file simulationserver.h. Referenced by GetArgC(), Run(), and SimulationServer(). |
|
the argv parameter passed to Run()
Definition at line 144 of file simulationserver.h. Referenced by GetArgV(), Run(), and SimulationServer(). |
|
true if the server automatically advances the simulation time mSimStep every cycle (this is the default), otherwise a SimControlNode is responsible to advance the ime
Definition at line 163 of file simulationserver.h. Referenced by GetAutoTimeMode(), Run(), SetAutoTimeMode(), and SimulationServer(). |
|
the current simulation cycle
Definition at line 166 of file simulationserver.h. Referenced by GetCycle(), Run(), and SimulationServer(). |
|
if true, the simulaion will exit on next simulation step
Definition at line 147 of file simulationserver.h. Referenced by CatchSignal(), Quit(), and Run(). |
|
a cached reference to the GameControlServer
Definition at line 172 of file simulationserver.h. Referenced by GetGameControlServer(), OnLink(), OnUnlink(), and Step(). |
|
a cached reference to the monitor server
Definition at line 169 of file simulationserver.h. Referenced by GetMonitorServer(), OnLink(), and OnUnlink(). |
|
a cached reference to the SceneServer
Definition at line 175 of file simulationserver.h. Referenced by GetSceneServer(), OnLink(), OnUnlink(), and Step(). |
|
the discrete simulation time step, or 0 for a non discrete simulation
Definition at line 154 of file simulationserver.h. Referenced by GetSimStep(), Run(), SetSimStep(), SimulationServer(), and Step(). |
|
the current simulation time
Definition at line 150 of file simulationserver.h. Referenced by GetTime(), Run(), SimulationServer(), and Step(). |
|
the accumulated simulation time since the last simulation step
Definition at line 158 of file simulationserver.h. Referenced by AdvanceTime(), GetSumDeltaTime(), SimulationServer(), and Step(). |