Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Simulation Class Reference

Keeps track of all of the simulation level stuff Deals with scheduling the entire simulation. Robot's time to calculate stuff, rendering, and user input. Basically this is like "main" for everything. More...

#include <Simulation/Simulation.h>

List of all members.

Public Types

enum  State { SIMULATION_STOPPED, SIMULATION_RUNNING }
 just a type for whether or not we're running the simulation now or not. Enums are nice

Public Member Functions

 Simulation (const ConStruct &init)
 Builds a Simulation object.
 ~Simulation ()
 Simulator destructor. Delete everything.
void TimeSlice (const double ms)
 Do one Epsilon time slice.
void Render (const IO_Window *win)
 Render the world.
void Update (IO_Window *win)
 Basically deals user input for a window.
void OnPress (IO_Window *win, const IO_Key &k)
 Handles key presses.
void OnRelease (IO_Window *win, const IO_Key &k)
 Handles key presses.
const Roadmap * getRoadmap (const int i) const
 returns the roadmap of the given index.
void SetCamera (const Camera *cam)
 Set's which camera we're using for rendering the display right now.
const Camera * GetCamera () const
 get's the camera that we're using for rendering the display right now

Public Attributes

bool wireframe
 whether to render wireframe or not
bool show_fps
 whether to show the frames per second or not

Friends

class SimulationFactory

Classes

class  SimulationFactory
 Class to be overloaded for building your workspace, the robot in it (arbitrator) and the path for it too follow.


Detailed Description

Keeps track of all of the simulation level stuff Deals with scheduling the entire simulation. Robot's time to calculate stuff, rendering, and user input. Basically this is like "main" for everything.


Constructor & Destructor Documentation

Simulation::Simulation const ConStruct &  init  ) 
 

Builds a Simulation object.

Parameters:
init,: the ConStruct from the configuration file telling us what we should load, and how to configure everything.
This is the part that loads the world, biulds the stuff that's going to live in our world, etc. We create the Workspace which contains the entire world, and functions supporting all IO with the world. We load the RoadMaps for use if we're showing off following a path. Lastly We load the Arbitrators which contain the Robots that are going to live in our world.


Member Function Documentation

const Camera * Simulation::GetCamera  )  const
 

get's the camera that we're using for rendering the display right now

Returns:
a pointer to the current cammera

const Roadmap * Simulation::getRoadmap const int  i  )  const
 

returns the roadmap of the given index.

Parameters:
i,: The Index of the roadmap that we want to get.
Returns:
The roadmap of index i.

void Simulation::OnPress IO_Window win,
const IO_Key k
 

Handles key presses.

Parameters:
win,: The window that we want to look at for key presses
k,: Information on what key we're talking about.

void Simulation::OnRelease IO_Window win,
const IO_Key k
 

Handles key presses.

Parameters:
win,: The window that we want to look at for key releases.
k,: Information on what key we're tlaking about.

void Simulation::Render const IO_Window win  ) 
 

Render the world.

Parameters:
win,: the window that we're rendering too
It renders.

void Simulation::TimeSlice const double  delta  ) 
 

Do one Epsilon time slice.

Parameters:
delta,how much time (in simulation time) should the robot's consider to have passed (for controling motion etc.)
This is the function called from the control loop that controls everything in the simulation while the simulation is running. We update the robots, we check the arbitrators to see if we should run their threads, and wake them up if we need too.

void Simulation::Update IO_Window win  ) 
 

Basically deals user input for a window.

Parameters:
win,: The window that we're updating
Checks for user input and calls the necicary functions. Also recalculates the projection stuff.


The documentation for this class was generated from the following files:
Generated on Fri Jan 12 14:15:02 2007 for Construct by  doxygen 1.4.3-20050530