#include <RoadSegment.h>
Public Member Functions | |
CIDMParameterSet * | getIDMParams (WORD veh_id) |
void | setIDMParams_Lowloader (CIDMParameterSet *Params) |
void | setIDMParams_LargeTruck (CIDMParameterSet *Params) |
void | setIDMParams_SmallTruck (CIDMParameterSet *Params) |
void | setIDMParams_Crane (CIDMParameterSet *Params) |
void | setIDMParams_Car (CIDMParameterSet *Params) |
bool | getDirPos () |
virtual void | removeVehicle (Vehicle *pVeh) |
virtual void | addVehicle (Vehicle *pVeh) |
void | setEnd (int end) |
void | setBeginning (int beginning) |
int | getEnd () const |
int | getBeginning () const |
RoadSegment () | |
virtual | ~RoadSegment () |
Static Public Member Functions | |
static bool | CompareSegments (const RoadSegment *a, const RoadSegment *b) |
A function to compare RoadSegments. | |
Protected Attributes | |
int | m_Beginning |
int | m_End |
bool | m_DirPos |
CIDMParameterSet * | m_pIDMParams_Car |
CIDMParameterSet * | m_pIDMParams_Crane |
CIDMParameterSet * | m_pIDMParams_SmallTruck |
CIDMParameterSet * | m_pIDMParams_LargeTruck |
CIDMParameterSet * | m_pIDMParams_Lowloader |
Definition at line 20 of file RoadSegment.h.
RoadSegment::RoadSegment | ( | ) |
RoadSegment::~RoadSegment | ( | ) | [virtual] |
CIDMParameterSet * RoadSegment::getIDMParams | ( | WORD | veh_id | ) |
Definition at line 88 of file RoadSegment.cpp.
References m_pIDMParams_Car, m_pIDMParams_Crane, m_pIDMParams_LargeTruck, m_pIDMParams_Lowloader, m_pIDMParams_SmallTruck, VEH_ID_CAR, VEH_ID_CRANE, VEH_ID_LARGETRUCK, VEH_ID_LOWLOADER, and VEH_ID_SMALLTRUCK.
Referenced by SpeedLimit::addVehicle().
00089 { 00090 switch(veh_id) 00091 { 00092 case VEH_ID_CAR: 00093 return m_pIDMParams_Car; 00094 case VEH_ID_SMALLTRUCK: 00095 return m_pIDMParams_SmallTruck; 00096 case VEH_ID_LARGETRUCK: 00097 return m_pIDMParams_LargeTruck; 00098 case VEH_ID_CRANE: 00099 return m_pIDMParams_Crane; 00100 case VEH_ID_LOWLOADER: 00101 return m_pIDMParams_Lowloader; 00102 default: 00103 return m_pIDMParams_Car; 00104 } 00105 }
void RoadSegment::setIDMParams_Lowloader | ( | CIDMParameterSet * | Params | ) |
Definition at line 83 of file RoadSegment.cpp.
References m_pIDMParams_Lowloader.
Referenced by Road::passIDMParameters().
00084 { 00085 m_pIDMParams_Lowloader = Params; 00086 }
void RoadSegment::setIDMParams_LargeTruck | ( | CIDMParameterSet * | Params | ) |
Definition at line 78 of file RoadSegment.cpp.
References m_pIDMParams_LargeTruck.
Referenced by Road::passIDMParameters().
00079 { 00080 m_pIDMParams_LargeTruck = Params; 00081 }
void RoadSegment::setIDMParams_SmallTruck | ( | CIDMParameterSet * | Params | ) |
Definition at line 73 of file RoadSegment.cpp.
References m_pIDMParams_SmallTruck.
Referenced by Road::passIDMParameters().
00074 { 00075 m_pIDMParams_SmallTruck = Params; 00076 }
void RoadSegment::setIDMParams_Crane | ( | CIDMParameterSet * | Params | ) |
Definition at line 68 of file RoadSegment.cpp.
References m_pIDMParams_Crane.
Referenced by Road::passIDMParameters().
00069 { 00070 m_pIDMParams_Crane = Params; 00071 }
void RoadSegment::setIDMParams_Car | ( | CIDMParameterSet * | Params | ) |
Definition at line 63 of file RoadSegment.cpp.
References m_pIDMParams_Car.
Referenced by Road::passIDMParameters().
00064 { 00065 m_pIDMParams_Car = Params; 00066 }
bool RoadSegment::getDirPos | ( | ) |
Definition at line 58 of file RoadSegment.cpp.
References m_DirPos.
00059 { 00060 return m_DirPos; 00061 }
bool RoadSegment::CompareSegments | ( | const RoadSegment * | a, | |
const RoadSegment * | b | |||
) | [static] |
A function to compare RoadSegments.
a | The first RoadSegment | |
b | The second RoadSegment |
Definition at line 114 of file RoadSegment.cpp.
References getBeginning().
Referenced by Road::init().
00115 { 00116 int startA = a->getBeginning(); 00117 int startB = b->getBeginning(); 00118 return startA < startB; 00119 }
void RoadSegment::removeVehicle | ( | Vehicle * | pVeh | ) | [virtual] |
void RoadSegment::addVehicle | ( | Vehicle * | pVeh | ) | [virtual] |
void RoadSegment::setEnd | ( | int | end | ) |
void RoadSegment::setBeginning | ( | int | beginning | ) |
Definition at line 38 of file RoadSegment.cpp.
References m_Beginning.
00039 { 00040 m_Beginning = beginning; 00041 }
int RoadSegment::getEnd | ( | ) | const |
Definition at line 33 of file RoadSegment.cpp.
References m_End.
00034 { 00035 return m_End; 00036 }
int RoadSegment::getBeginning | ( | ) | const |
Definition at line 28 of file RoadSegment.cpp.
References m_Beginning.
Referenced by CompareSegments().
00029 { 00030 return m_Beginning; 00031 }
int RoadSegment::m_Beginning [protected] |
Definition at line 43 of file RoadSegment.h.
Referenced by getBeginning(), Gradient::Gradient(), setBeginning(), and SpeedLimit::SpeedLimit().
int RoadSegment::m_End [protected] |
Definition at line 44 of file RoadSegment.h.
Referenced by getEnd(), Gradient::Gradient(), setEnd(), and SpeedLimit::SpeedLimit().
bool RoadSegment::m_DirPos [protected] |
Definition at line 45 of file RoadSegment.h.
Referenced by getDirPos(), Gradient::Gradient(), and SpeedLimit::SpeedLimit().
CIDMParameterSet* RoadSegment::m_pIDMParams_Car [protected] |
CIDMParameterSet* RoadSegment::m_pIDMParams_Crane [protected] |
Definition at line 47 of file RoadSegment.h.
Referenced by getIDMParams(), and setIDMParams_Crane().
CIDMParameterSet* RoadSegment::m_pIDMParams_SmallTruck [protected] |
Definition at line 48 of file RoadSegment.h.
Referenced by getIDMParams(), and setIDMParams_SmallTruck().
CIDMParameterSet* RoadSegment::m_pIDMParams_LargeTruck [protected] |
Definition at line 49 of file RoadSegment.h.
Referenced by getIDMParams(), and setIDMParams_LargeTruck().
CIDMParameterSet* RoadSegment::m_pIDMParams_Lowloader [protected] |
Definition at line 50 of file RoadSegment.h.
Referenced by getIDMParams(), and setIDMParams_Lowloader().