#include <Sim.h>
Public Member Functions | |
void | setFileIn (string file) |
Sets the file to read input from. | |
void | setFileOut (string file) |
Sets the file to write output to. | |
void | setFileType (WORD fileType) |
Sets the file type of the input. | |
void | setNoLanesDirPos (int nlpos) |
Sets the number of lanes in the positive direction. | |
void | setNoLanesDirNeg (int nlneg) |
Sets the number of lanes in the negative direction. | |
void | setSimTimeStep (double ts) |
Sets the size of the timestep. | |
void | setNoDirections (int nd) |
Sets the number of directions. | |
void | setNoLanes (int nl) |
Sets the number of lanes. | |
void | setRoadLength (int L) |
Sets the length of the road. | |
double | getCurrentSimTime () |
Gets the current time of the simulation. | |
Road * | getRoad () |
Gets the simulation's road object. | |
double | getRoadLength () |
Gets the length of the road. | |
M2D | getPositions () |
Gets all the vehicles on the road. | |
M2D | doOneTimeStep (bool *pInSimulation) |
Steps the simulation forward by one timestep. | |
void | init () |
Initialises the simulation. | |
Sim () | |
Default Constructor. | |
virtual | ~Sim () |
Default Destructor. | |
Private Attributes | |
double | m_CurrentSimTime |
Road | m_Road |
M2D | m_vVehicles |
string | m_FileIn |
string | m_FileOut |
WORD | m_FileType |
int | m_NoLanesDirPos |
int | m_NoLanesDirNeg |
double | m_SimTimeStep |
int | m_NoDirections |
int | m_NoLanes |
int | m_RoadLength |
Sim::Sim | ( | ) |
Default Constructor.
Sim::~Sim | ( | ) | [virtual] |
Default Destructor.
void Sim::setFileIn | ( | string | file | ) |
Sets the file to read input from.
file | The file to read input from |
void Sim::setFileOut | ( | string | file | ) |
Sets the file to write output to.
file | The file to write output to |
void Sim::setFileType | ( | WORD | fileType | ) |
Sets the file type of the input.
fileType | The file type of the input |
void Sim::setNoLanesDirPos | ( | int | nlpos | ) |
Sets the number of lanes in the positive direction.
nlpos | The number of lanes in the positive direction |
void Sim::setNoLanesDirNeg | ( | int | nlneg | ) |
Sets the number of lanes in the negative direction.
nlneg | The number of lanes in the negative direction |
void Sim::setSimTimeStep | ( | double | ts | ) |
Sets the size of the timestep.
ts | The size of the timestep |
void Sim::setNoDirections | ( | int | nd | ) |
Sets the number of directions.
nd | The number of directions |
void Sim::setNoLanes | ( | int | nl | ) |
Sets the number of lanes.
nl | The number of lanes |
void Sim::setRoadLength | ( | int | L | ) |
Sets the length of the road.
L | The length of the road |
double Sim::getCurrentSimTime | ( | ) |
Gets the current time of the simulation.
Road * Sim::getRoad | ( | ) |
Gets the simulation's road object.
double Sim::getRoadLength | ( | ) |
Gets the length of the road.
M2D Sim::getPositions | ( | ) |
Gets all the vehicles on the road.
M2D Sim::doOneTimeStep | ( | bool * | pInSimulation | ) |
Steps the simulation forward by one timestep.
pInSimulation | Whether or not the simulation is still running |
void Sim::init | ( | ) |
Initialises the simulation.
This function takes data which has been passed from the Graphical User Interface, and initialises the Road object with this data.
double Sim::m_CurrentSimTime [private] |
Road Sim::m_Road [private] |
M2D Sim::m_vVehicles [private] |
string Sim::m_FileIn [private] |
string Sim::m_FileOut [private] |
WORD Sim::m_FileType [private] |
int Sim::m_NoLanesDirPos [private] |
int Sim::m_NoLanesDirNeg [private] |
double Sim::m_SimTimeStep [private] |
int Sim::m_NoDirections [private] |
int Sim::m_NoLanes [private] |
int Sim::m_RoadLength [private] |