RoadSegment Class Reference

A base class from which specific special road segments are derived. More...

#include <RoadSegment.h>

Inheritance diagram for RoadSegment:

Inheritance graph
[legend]
Collaboration diagram for RoadSegment:

Collaboration graph
[legend]

List of all members.

Public Member Functions

CIDMParameterSetgetIDMParams (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
CIDMParameterSetm_pIDMParams_Car
CIDMParameterSetm_pIDMParams_Crane
CIDMParameterSetm_pIDMParams_SmallTruck
CIDMParameterSetm_pIDMParams_LargeTruck
CIDMParameterSetm_pIDMParams_Lowloader


Detailed Description

A base class from which specific special road segments are derived.

Definition at line 20 of file RoadSegment.h.


Constructor & Destructor Documentation

RoadSegment::RoadSegment (  ) 

Definition at line 18 of file RoadSegment.cpp.

00019 {
00020 
00021 }

RoadSegment::~RoadSegment (  )  [virtual]

Definition at line 23 of file RoadSegment.cpp.

00024 {
00025 
00026 }


Member Function Documentation

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.

Parameters:
a The first RoadSegment
b The second RoadSegment
Returns:
Whether the first segment's starting point is less than the second.

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 }

Here is the call graph for this function:

void RoadSegment::removeVehicle ( Vehicle pVeh  )  [virtual]

Reimplemented in Gradient, and SpeedLimit.

Definition at line 53 of file RoadSegment.cpp.

00054 {
00055 
00056 }

void RoadSegment::addVehicle ( Vehicle pVeh  )  [virtual]

Reimplemented in Gradient, and SpeedLimit.

Definition at line 48 of file RoadSegment.cpp.

00049 {
00050 
00051 }

void RoadSegment::setEnd ( int  end  ) 

Definition at line 43 of file RoadSegment.cpp.

References m_End.

00044 {
00045         m_End = end;
00046 }

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 }


Member Data Documentation

int RoadSegment::m_Beginning [protected]

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().

Definition at line 46 of file RoadSegment.h.

Referenced by getIDMParams(), and setIDMParams_Car().

Definition at line 47 of file RoadSegment.h.

Referenced by getIDMParams(), and setIDMParams_Crane().

Definition at line 48 of file RoadSegment.h.

Referenced by getIDMParams(), and setIDMParams_SmallTruck().

Definition at line 49 of file RoadSegment.h.

Referenced by getIDMParams(), and setIDMParams_LargeTruck().

Definition at line 50 of file RoadSegment.h.

Referenced by getIDMParams(), and setIDMParams_Lowloader().


The documentation for this class was generated from the following files:

Generated on Wed Aug 20 00:48:50 2008 for EvolveTraffic by  doxygen 1.5.6