#include <Vehicle.h>
Public Member Functions | |
void | init (int RoadLength, bool DriveOnRIght) |
int | getLaneNoInDirection () |
void | setTotalNoLanesInRoad (int nLanes) |
Vehicle () | |
Default Constructor. | |
virtual | ~Vehicle () |
Default Destructor. | |
void | setTime (double time) |
void | setChangeStatus (bool stat) |
Sets whether or not the Vehicle wishes to change lanes. | |
void | setRoadPos (double r) |
Sets the position of the Vehicle on the road. | |
void | setPos (double p) |
Sets the position of the Vehicle to a given value. | |
void | setAccel (double acceler) |
Sets the acceleration of the Vehicle to a given value. | |
void | setLength (double length) |
Sets the length of the Vehicle to a given value. | |
void | setVelocity (double velocity) |
Sets the velocity of the Vehicle to a given value. | |
void | setLane (int l) |
Sets the lane that the Vehicle is in. | |
void | setDirection (bool DirPointsRight) |
Sets the direction of the Vehicle. | |
void | setGVW (double weight) |
Sets the GVW of the vehicle to a given weight. | |
void | setAxles () |
Sets the vehicle's number of axles to a given number. | |
void | setAW (int i, double w) |
Sets the weight of a given axle. | |
void | setAxles (int axNo) |
void | setAS (int i, double s) |
Sets the spacing of a given axle. | |
CString | getDataString () |
virtual double | getTime () const |
Gets the time of arrival of the vehicle in seconds. | |
void | setRoadLength (int length) |
bool | getChangeStatus () |
Gets whether or not the Vehicle wishes to change lane. | |
double | getRoadPos () |
Gets the position of the Vehicle on the road. | |
double | getPos () |
Gets the Vehicle's position. | |
double | getDesiredVel () |
Gets the desired velocity of the Vehicle's driver model. | |
double | getAccel () |
Gets the acceleration of the Vehicle. | |
double | getLength () |
Gets the length of the Vehicle. | |
double | getVelocity () |
Gets the velocity of the Vehicle. | |
int | getLane () |
Gets the lane that the Vehicle is in. | |
bool | getDirection () |
Gets the direction that the Vehicle is travelling in. | |
WORD | getID () |
Gets the class of the Vehicle. | |
double | getGVW () |
Gets the GVW of the vehicle. | |
int | getNoAxles () |
Gets the vehicle's number of axles. | |
double | getAW (int i) |
Gets the weight of a given axle. | |
double | getAS (int i) |
Gets the spacing of a given axle. | |
DriverModel * | getDriver () |
Gets the Vehicle's DriverModel. | |
void | setDriver (IDM driver) |
Sets the Vehicle's DriverModel. | |
void | createSAFTVehicle (std::string data) |
void | createCASTORVehicle (std::string data) |
void | writeSAFTData (char *pTruck) |
Prepares a vehicle for printing to a SAFT file. | |
void | writeCASTORData (char *pTruck) |
Prepares a vehicle for printing to a CASTOR file. | |
void | updateProperties (double step, double accel) |
Updates the velocity, acceleration and position of the Vehicle based its acceleration and the timestep. | |
void | update (double step, Vehicle *pV) |
Updates the position of the Vehicle based on the timestep and preceding Vehicle. | |
void | update (double step) |
Updates the position of the Vehicle based on the timestep. | |
double | calcAccel () |
Calculates a Vehicle's acceleration when unimpeded by other Vehicles. | |
bool | changeTime (double step) |
Handles the timer for checking Lane changes. | |
double | calcAccel (Vehicle *pV) |
Calculates a Vehicle's acceleration based on properties of the preceding Vehicle. | |
int | DecideNextLane (double LeftAdv, double RightAdv) |
double | DecideLaneChange (Vehicle *frontVeh, Vehicle *backVeh, bool overtake) |
int | DecideLaneChange (Vehicle *LeftFrontVehicle, Vehicle *LeftBackVehicle, Vehicle *RightFrontVehicle, Vehicle *RightBackVehicle, bool LeftLaneExists, bool RightLaneExists) |
Handles whether or not the Vehicle will change Lane. | |
Protected Member Functions | |
int | Round (double val) |
WORD | setID () |
double | LaneChangeAdvantage (Vehicle *FrontVehicle, Vehicle *BackVehicle, bool overtake) |
Gets the advantage a Vehicle would gain from switching Lanes. | |
Protected Attributes | |
DriverModel * | m_pDriver |
IDM | m_IDMDriver |
bool | m_DriveOnRight |
bool | m_DirPos |
int | m_intDir |
int | m_Lane |
int | m_RoadLength |
double | m_Position |
double | m_RoadPosition |
double | m_Velocity |
double | m_Acceleration |
int | m_Order |
int | m_Head |
int | m_Year |
int | m_Month |
int | m_Day |
int | m_Hour |
int | m_Min |
int | m_Sec |
int | m_Hndt |
double | m_GVW |
int | m_Trns |
int | m_NoAxles |
double | m_Length |
std::vector< Axle * > | m_vAxles |
WORD | m_ID |
bool | m_bLaneChange |
double | m_Tdelay |
int | m_TotalNoLanesInRoad |
int | ROAD_END_BUFFER |
double | T_DELAY |
double | MIN_SPACE_FOR_NEXT_VEHICLE |
double | SAFE_BRAKING |
double | CRANE_AVERAGE_SPACING |
double | CRANE_MAX_SPACING |
double | LOWLOADER_MIN_MAX_SPACING |
int | SMALL_TRUCK_NO_AXLES |
int | DAYS_PER_MT |
int | MTS_PER_YR |
Definition at line 14 of file Vehicle.h.
Vehicle::Vehicle | ( | ) |
Default Constructor.
Definition at line 12 of file Vehicle.cpp.
References CConfigData::VehicleID_Config::CRANE_AVERAGE_SPACING, CRANE_AVERAGE_SPACING, CConfigData::VehicleID_Config::CRANE_MAX_SPACING, CRANE_MAX_SPACING, CConfigData::Time_Config::DAYS_PER_MT, DAYS_PER_MT, CConfigData::IDM, CConfigData::VehicleID_Config::LOWLOADER_MIN_MAX_SPACING, LOWLOADER_MIN_MAX_SPACING, CConfigData::IDM_Config::MIN_SPACE_FOR_NEXT_VEHICLE, MIN_SPACE_FOR_NEXT_VEHICLE, CConfigData::Time_Config::MTS_PER_YR, MTS_PER_YR, CConfigData::Road, CConfigData::Road_Config::ROAD_END_BUFFER, ROAD_END_BUFFER, CConfigData::IDM_Config::SAFE_BRAKING, SAFE_BRAKING, CConfigData::VehicleID_Config::SMALL_TRUCK_NO_AXLES, SMALL_TRUCK_NO_AXLES, CConfigData::IDM_Config::T_DELAY, T_DELAY, CConfigData::Time, and CConfigData::VehicleID.
00013 { 00014 ROAD_END_BUFFER = g_ConfigData.Road.ROAD_END_BUFFER; 00015 00016 T_DELAY = g_ConfigData.IDM.T_DELAY; 00017 MIN_SPACE_FOR_NEXT_VEHICLE = g_ConfigData.IDM.MIN_SPACE_FOR_NEXT_VEHICLE; 00018 SAFE_BRAKING = g_ConfigData.IDM.SAFE_BRAKING; 00019 00020 CRANE_AVERAGE_SPACING = g_ConfigData.VehicleID.CRANE_AVERAGE_SPACING; 00021 CRANE_MAX_SPACING = g_ConfigData.VehicleID.CRANE_MAX_SPACING; 00022 LOWLOADER_MIN_MAX_SPACING = g_ConfigData.VehicleID.LOWLOADER_MIN_MAX_SPACING; 00023 SMALL_TRUCK_NO_AXLES = g_ConfigData.VehicleID.SMALL_TRUCK_NO_AXLES; 00024 00025 DAYS_PER_MT = g_ConfigData.Time.DAYS_PER_MT; 00026 MTS_PER_YR = g_ConfigData.Time.MTS_PER_YR; 00027 }
Vehicle::~Vehicle | ( | ) | [virtual] |
void Vehicle::init | ( | int | RoadLength, | |
bool | DriveOnRIght | |||
) |
Definition at line 561 of file Vehicle.cpp.
References m_DriveOnRight, and m_RoadLength.
00562 { 00563 m_RoadLength = RoadLength; 00564 m_DriveOnRight = DriveOnRight; 00565 }
int Vehicle::getLaneNoInDirection | ( | ) |
Definition at line 645 of file Vehicle.cpp.
References m_DirPos, m_Lane, and m_TotalNoLanesInRoad.
Referenced by MetricsDetector::AddCurrentVehicle(), and writeCASTORData().
00646 { 00647 if(m_DirPos) // if pos direction, local = global 00648 return m_Lane; 00649 else // if neg, it's not 00650 { 00651 ASSERT(m_Lane <= m_TotalNoLanesInRoad); // if it isn't we have a negative index returned 00652 int iLocalLane = m_TotalNoLanesInRoad - m_Lane + 1; // must be 1-based lane index for file output 00653 return iLocalLane; 00654 } 00655 }
void Vehicle::setTotalNoLanesInRoad | ( | int | nLanes | ) |
Definition at line 639 of file Vehicle.cpp.
References m_TotalNoLanesInRoad.
Referenced by Road::MapTrafLaneToSimLane().
00640 { 00641 m_TotalNoLanesInRoad = nLanes; 00642 }
void Vehicle::setTime | ( | double | time | ) |
Definition at line 534 of file Vehicle.cpp.
References DAYS_PER_MT, HOURS_PER_DAY, m_Day, m_Hndt, m_Hour, m_Min, m_Month, m_Sec, m_Year, MINS_PER_HOUR, MTS_PER_YR, and SECS_PER_HOUR.
Referenced by OutputDetector::addVehicle().
00535 { 00536 double temp = time; 00537 const int mpy = MTS_PER_YR; const int dpm = DAYS_PER_MT; 00538 00539 m_Year = (int)(temp/(MTS_PER_YR * DAYS_PER_MT * HOURS_PER_DAY * SECS_PER_HOUR)); 00540 00541 temp = time - m_Year * MTS_PER_YR * DAYS_PER_MT * HOURS_PER_DAY * SECS_PER_HOUR; 00542 m_Month = (int)(temp/(DAYS_PER_MT * HOURS_PER_DAY * SECS_PER_HOUR)); 00543 00544 temp = temp - m_Month * DAYS_PER_MT * HOURS_PER_DAY * SECS_PER_HOUR; 00545 m_Day = (int)(temp/(HOURS_PER_DAY * SECS_PER_HOUR)); 00546 00547 temp = temp - m_Day * HOURS_PER_DAY * SECS_PER_HOUR; 00548 m_Hour = (int)(temp/(SECS_PER_HOUR)); 00549 00550 temp = temp - m_Hour * SECS_PER_HOUR; 00551 m_Min = (int)(temp/(MINS_PER_HOUR)); 00552 00553 temp = temp - m_Min * MINS_PER_HOUR; 00554 m_Sec = (int)(temp); 00555 00556 temp = temp - m_Sec; 00557 m_Hndt = (int)(100 * temp); 00558 00559 }
void Vehicle::setChangeStatus | ( | bool | stat | ) |
Sets whether or not the Vehicle wishes to change lanes.
stat | whether or not the Vehicle wants to change lanes |
Definition at line 360 of file Vehicle.cpp.
References m_bLaneChange.
Referenced by update().
00361 { 00362 m_bLaneChange = stat; 00363 }
void Vehicle::setRoadPos | ( | double | r | ) |
Sets the position of the Vehicle on the road.
For graphical use
r | the Vehicle's position on the road |
Definition at line 369 of file Vehicle.cpp.
References m_RoadPosition.
00370 { 00371 m_RoadPosition = r; 00372 }
void Vehicle::setPos | ( | double | p | ) |
Sets the position of the Vehicle to a given value.
p | the Vehicle's position |
Definition at line 351 of file Vehicle.cpp.
References m_Position.
00352 { 00353 m_Position = p; 00354 }
void Vehicle::setAccel | ( | double | acc | ) |
Sets the acceleration of the Vehicle to a given value.
acc | the Vehicle's new acceleration |
Definition at line 322 of file Vehicle.cpp.
References m_Acceleration.
00323 { 00324 m_Acceleration = acc; 00325 }
void Vehicle::setLength | ( | double | length | ) |
Sets the length of the Vehicle to a given value.
length | The Vehicle's new length |
Definition at line 313 of file Vehicle.cpp.
References m_Length.
00314 { 00315 m_Length = length; 00316 }
void Vehicle::setVelocity | ( | double | vel | ) |
Sets the velocity of the Vehicle to a given value.
vel | the Vehicle's new velocity |
Definition at line 304 of file Vehicle.cpp.
References m_Velocity.
00305 { 00306 m_Velocity = vel; 00307 }
void Vehicle::setLane | ( | int | lane | ) |
Sets the lane that the Vehicle is in.
lane | the Vehicle's lane |
Definition at line 331 of file Vehicle.cpp.
References m_Lane.
Referenced by Lane::ImplementLaneChange(), and Road::MapTrafLaneToSimLane().
00332 { 00333 m_Lane = lane; 00334 }
void Vehicle::setDirection | ( | bool | DirPos | ) |
Sets the direction of the Vehicle.
DirPos | Whether or not the vehicle is travelling in a positive direction |
Definition at line 341 of file Vehicle.cpp.
References m_DirPos.
00342 { 00343 m_DirPos = DirPos; 00344 }
void Vehicle::setGVW | ( | double | weight | ) |
Sets the GVW of the vehicle to a given weight.
weight | the desired GVW |
Reimplemented in Truck.
Definition at line 477 of file Vehicle.cpp.
References m_GVW.
00478 { 00479 m_GVW = weight; 00480 }
void Vehicle::setAxles | ( | ) |
Sets the vehicle's number of axles to a given number.
This function sets the vehicle's number of Axles and current differentiates between large and small trucks based on the number of Axles
Definition at line 607 of file Vehicle.cpp.
References m_NoAxles, and m_vAxles.
Referenced by createCASTORVehicle(), and createSAFTVehicle().
00608 { 00609 for(int i = 0; i < m_NoAxles; i++) 00610 { 00611 Axle* axle = new Axle(); 00612 m_vAxles.push_back(axle); 00613 } 00614 }
void Vehicle::setAW | ( | int | i, | |
double | w | |||
) |
Sets the weight of a given axle.
i | the axle to operate upon | |
w | the desired weight |
Reimplemented in Truck.
Definition at line 597 of file Vehicle.cpp.
References m_vAxles.
Referenced by createCASTORVehicle(), and createSAFTVehicle().
00598 { 00599 m_vAxles.at(i)->setWeight(w); 00600 }
void Vehicle::setAxles | ( | int | axNo | ) |
void Vehicle::setAS | ( | int | i, | |
double | s | |||
) |
Sets the spacing of a given axle.
The space of a given axle to the next axle
i | the axle to operate upon | |
s | the desired spacing |
Reimplemented in Truck.
Definition at line 588 of file Vehicle.cpp.
References m_vAxles.
Referenced by createCASTORVehicle(), and createSAFTVehicle().
00589 { 00590 m_vAxles.at(i)->setSpacing(s); 00591 }
CString Vehicle::getDataString | ( | ) |
Definition at line 881 of file Vehicle.cpp.
References IDM::get_A(), IDM::get_B(), IDM::get_Bias(), IDM::get_Delta(), IDM::get_DeltaAth(), IDM::get_Polite(), IDM::get_S0(), IDM::get_S1(), IDM::get_T(), IDM::get_V0(), getAS(), getAW(), DriverModel::getDesiredVel(), m_Acceleration, m_DirPos, m_GVW, m_IDMDriver, m_Lane, m_Length, m_NoAxles, m_pDriver, M_PER_S_TO_KM_PER_H, m_RoadPosition, and m_Velocity.
Referenced by CEvolveTrafficView::OnLButtonDown().
00882 { 00883 CString dataStr, tempStr, strSplitter; 00884 strSplitter = "-----------------------------------\n"; 00885 00886 dataStr = "Vehicle Data:\n"; 00887 dataStr += strSplitter; 00888 dataStr += "Direction: \t"; 00889 tempStr = m_DirPos ? "Positive\n" : "Negative\n"; 00890 dataStr += tempStr; 00891 00892 tempStr.Format("Lane: \t%d\n", m_Lane); dataStr += tempStr; 00893 tempStr.Format("Position: \t%4.1f m\n", m_RoadPosition); dataStr += tempStr; 00894 tempStr.Format("Velocity: \t%3.1f km/h\n", m_Velocity*M_PER_S_TO_KM_PER_H); dataStr += tempStr; 00895 tempStr.Format("Acceleration:\t%2.2f m/s^2\n", m_Acceleration); dataStr += tempStr; 00896 tempStr.Format("Desired Vel.:\t%3.1f km/h\n", m_pDriver->getDesiredVel()*M_PER_S_TO_KM_PER_H); dataStr += tempStr; 00897 00898 dataStr += strSplitter; 00899 00900 tempStr.Format("IDM T: \t\t%1.2f s\n", m_IDMDriver.get_T() ); dataStr += tempStr; 00901 tempStr.Format("IDM A: \t\t%2.2f m/s^2\n", m_IDMDriver.get_A() ); dataStr += tempStr; 00902 tempStr.Format("IDM B: \t\t%2.2f m/s^2\n", m_IDMDriver.get_B() ); dataStr += tempStr; 00903 tempStr.Format("IDM S0:\t\t%2.2f m\n", m_IDMDriver.get_S0() ); dataStr += tempStr; 00904 tempStr.Format("IDM S1:\t\t%2.2f m\n", m_IDMDriver.get_S1() ); dataStr += tempStr; 00905 tempStr.Format("IDM V0:\t\t%3.1f m/s\n", m_IDMDriver.get_V0() ); dataStr += tempStr; 00906 tempStr.Format("IDM Delta:\t%2.1f\n", m_IDMDriver.get_Delta() ); dataStr += tempStr; 00907 tempStr.Format("IDM Polite:\t%2.1f\n", m_IDMDriver.get_Polite() ); dataStr += tempStr; 00908 tempStr.Format("IDM Bias:\t%2.1f\n", m_IDMDriver.get_Bias() ); dataStr += tempStr; 00909 tempStr.Format("IDM DeltaAth:\t%2.1f\n", m_IDMDriver.get_DeltaAth() ); dataStr += tempStr; 00910 00911 dataStr += strSplitter; 00912 00913 tempStr.Format("GVW: \t%3.1f kN\n", m_GVW); dataStr += tempStr; 00914 tempStr.Format("Length: \t%2.1f m\n", m_Length); dataStr += tempStr; 00915 tempStr.Format("No of Axles: \t%d\n", m_NoAxles); dataStr += tempStr; 00916 00917 for(int i = 0; i < m_NoAxles; i++) 00918 { 00919 tempStr.Format("Axle %d:\t", i+1); dataStr += tempStr; 00920 tempStr.Format("%2.1f kN", getAW(i) ); dataStr += tempStr; 00921 if(i < m_NoAxles - 1) 00922 { 00923 tempStr.Format(" | %2.1f m\n",getAS(i) ); dataStr += tempStr; 00924 } 00925 } 00926 00927 return dataStr; 00928 }
double Vehicle::getTime | ( | ) | const [virtual] |
Gets the time of arrival of the vehicle in seconds.
Definition at line 522 of file Vehicle.cpp.
References DAYS_PER_MT, HOURS_PER_DAY, m_Day, m_Hndt, m_Hour, m_Min, m_Month, m_Sec, m_Year, MTS_PER_YR, SECS_PER_HOUR, and SECS_PER_MIN.
Referenced by Truck::operator<().
00523 { 00524 // working off a 10 month year & a 25 day month 00525 int s_per_hr = SECS_PER_HOUR; 00526 int s_per_day = SECS_PER_HOUR*HOURS_PER_DAY; 00527 00528 int no_days = (m_Year - 5) * MTS_PER_YR * DAYS_PER_MT + (m_Month - 1) * DAYS_PER_MT + (m_Day-1); 00529 double time = no_days * s_per_day + m_Hour * s_per_hr + m_Min * SECS_PER_MIN + m_Sec + (double)m_Hndt/100; 00530 00531 return time; 00532 }
void Vehicle::setRoadLength | ( | int | length | ) |
Definition at line 567 of file Vehicle.cpp.
References m_RoadLength.
00568 { 00569 m_RoadLength = length; 00570 }
bool Vehicle::getChangeStatus | ( | ) |
Gets whether or not the Vehicle wishes to change lane.
Definition at line 415 of file Vehicle.cpp.
References m_bLaneChange.
00416 { 00417 return m_bLaneChange; 00418 }
double Vehicle::getRoadPos | ( | ) |
Gets the position of the Vehicle on the road.
Graphical use
Definition at line 397 of file Vehicle.cpp.
References m_RoadPosition.
Referenced by CEvolveTrafficView::DrawVehicle(), and CEvolveTrafficView::FindVehicle().
00398 { 00399 return m_RoadPosition; 00400 }
double Vehicle::getPos | ( | ) |
Gets the Vehicle's position.
Definition at line 379 of file Vehicle.cpp.
References m_Position.
Referenced by calcAccel(), Lane::ChangeLanes(), Detector::FindDetectorArrivalTime(), Lane::ImplementLaneChange(), Lane::insert(), and LaneChangeAdvantage().
00380 { 00381 return m_Position; 00382 }
double Vehicle::getDesiredVel | ( | ) |
Gets the desired velocity of the Vehicle's driver model.
Definition at line 388 of file Vehicle.cpp.
References DriverModel::getDesiredVel(), and m_pDriver.
Referenced by SpeedLimit::addVehicle().
00389 { 00390 return m_pDriver->getDesiredVel(); 00391 }
double Vehicle::getAccel | ( | ) |
Gets the acceleration of the Vehicle.
Definition at line 442 of file Vehicle.cpp.
References m_Acceleration.
Referenced by LaneChangeAdvantage().
00443 { 00444 return m_Acceleration; 00445 }
double Vehicle::getLength | ( | ) |
Gets the length of the Vehicle.
Definition at line 433 of file Vehicle.cpp.
References m_Length.
Referenced by calcAccel(), CEvolveTrafficView::DrawVehicle(), CEvolveTrafficView::FindVehicle(), and LaneChangeAdvantage().
00434 { 00435 return m_Length; 00436 }
double Vehicle::getVelocity | ( | ) |
Gets the velocity of the Vehicle.
Definition at line 424 of file Vehicle.cpp.
References m_Velocity.
Referenced by MetricsDetector::AddCurrentVehicle(), calcAccel(), CEvolveTrafficView::DrawVehicle(), and Detector::FindDetectorArrivalTime().
00425 { 00426 return m_Velocity; 00427 }
int Vehicle::getLane | ( | ) |
Gets the lane that the Vehicle is in.
Definition at line 451 of file Vehicle.cpp.
References m_Lane.
Referenced by CEvolveTrafficView::DrawVehicle(), Lane::ImplementLaneChange(), and Road::MapTrafLaneToSimLane().
00452 { 00453 return m_Lane; 00454 }
bool Vehicle::getDirection | ( | ) |
Gets the direction that the Vehicle is travelling in.
Definition at line 460 of file Vehicle.cpp.
References m_DirPos.
Referenced by Lane::ChangeLanes(), CEvolveTrafficView::DrawVehicle(), CEvolveTrafficView::FindVehicle(), Lane::ImplementLaneChange(), and Road::MapTrafLaneToSimLane().
00461 { 00462 return m_DirPos; 00463 }
WORD Vehicle::getID | ( | ) |
Gets the class of the Vehicle.
Reimplemented in Truck.
Definition at line 406 of file Vehicle.cpp.
References m_ID.
Referenced by MetricsDetector::AddCurrentVehicle(), SpeedLimit::addVehicle(), MetricsDetector::addVehicle(), CEvolveTrafficView::DrawVehicle(), Lane::ImplementLaneChange(), and Road::setIDMDriverModel().
00407 { 00408 return m_ID; 00409 }
double Vehicle::getGVW | ( | ) |
Gets the GVW of the vehicle.
Definition at line 469 of file Vehicle.cpp.
References m_GVW.
00470 { 00471 return m_GVW; 00472 }
int Vehicle::getNoAxles | ( | ) |
Gets the vehicle's number of axles.
Reimplemented in Truck.
Definition at line 576 of file Vehicle.cpp.
References m_NoAxles.
00577 { 00578 return m_NoAxles; 00579 }
double Vehicle::getAW | ( | int | i | ) |
Gets the weight of a given axle.
i | the axle to operate upon |
Reimplemented in Truck.
Definition at line 633 of file Vehicle.cpp.
References m_vAxles.
Referenced by getDataString(), writeCASTORData(), and writeSAFTData().
00634 { 00635 return m_vAxles.at(i)->getWeight(); 00636 }
double Vehicle::getAS | ( | int | i | ) |
Gets the spacing of a given axle.
The space of a given axle to the next axle
i | the axle to operate upon |
Reimplemented in Truck.
Definition at line 623 of file Vehicle.cpp.
References m_vAxles.
Referenced by getDataString(), setID(), writeCASTORData(), and writeSAFTData().
00624 { 00625 return m_vAxles.at(i)->getSpacing(); 00626 }
DriverModel * Vehicle::getDriver | ( | ) |
Gets the Vehicle's DriverModel.
Definition at line 169 of file Vehicle.cpp.
References m_pDriver.
Referenced by SpeedLimit::addVehicle(), Gradient::addVehicle(), Lane::CheckRoadSegments(), SpeedLimit::removeVehicle(), and Gradient::removeVehicle().
00170 { 00171 return m_pDriver; 00172 }
void Vehicle::setDriver | ( | IDM | driver | ) |
Sets the Vehicle's DriverModel.
driver | The Vehicle's driver |
Definition at line 177 of file Vehicle.cpp.
References m_IDMDriver, and m_pDriver.
Referenced by Road::setIDMDriverModel().
00178 { 00179 m_IDMDriver = driver; 00180 m_pDriver = &m_IDMDriver; 00181 }
void Vehicle::createSAFTVehicle | ( | std::string | data | ) |
Reimplemented in Truck.
Definition at line 717 of file Vehicle.cpp.
References m_Day, m_GVW, m_Head, m_Hndt, m_Hour, m_ID, m_intDir, m_Lane, m_Length, m_Min, m_Month, m_NoAxles, m_Order, m_Position, m_RoadPosition, m_Sec, m_Tdelay, m_Velocity, m_Year, setAS(), setAW(), setAxles(), and setID().
Referenced by Truck::createSAFTVehicle(), and SAFTFile::readLine().
00718 { 00719 m_Position = 0.0; 00720 m_RoadPosition = m_Position; 00721 00722 m_Order = atoi( data.substr(0,5).c_str() ); 00723 m_Head = 20005; 00724 m_Day = atoi( data.substr(10,2).c_str() ); 00725 m_Month = atoi( data.substr(12,2).c_str() ); 00726 m_Year = atoi( data.substr(14,2).c_str() ); 00727 m_Hour = atoi( data.substr(16,2).c_str() ); 00728 m_Min = atoi( data.substr(18,2).c_str() ); 00729 m_Sec = atoi( data.substr(20,2).c_str() ); 00730 m_Hndt = atoi( data.substr(22,2).c_str() ); 00731 m_Velocity = atoi( data.substr(24,3).c_str() ); 00732 m_GVW = atoi( data.substr(27,4).c_str() ); 00733 m_Length = atoi( data.substr(31,3).c_str() ); 00734 m_NoAxles = atoi( data.substr(34,1).c_str() ); 00735 00736 m_Lane = 1; 00737 m_intDir = 1; // m_DirPointsToRight = true; 00738 00739 // Length = length/10 for dm to meters 00740 // Vel = vel / 10 for dm/s to meters/second 00741 m_Length /= 10; 00742 m_Velocity /= 10; 00743 00744 m_Tdelay = 0.0; 00745 00746 setAxles(); 00747 double W; 00748 double S; 00749 int j = 33; 00750 00751 for(int i = 0; i < m_NoAxles; i++) 00752 { 00753 j += 2; 00754 W = atoi( data.substr(j,3).c_str() ); 00755 setAW(i, W); 00756 00757 if(i == m_NoAxles-1) break; 00758 00759 j += 3; 00760 S = atoi( data.substr(j,2).c_str() ); 00761 S /= 10; // convert to m 00762 setAS(i, S); 00763 } 00764 00765 m_ID = setID(); // why is this here 00766 }
void Vehicle::createCASTORVehicle | ( | std::string | data | ) |
Reimplemented in Truck.
Definition at line 661 of file Vehicle.cpp.
References KG100_TO_KN, m_Day, m_DirPos, m_GVW, m_Head, m_Hndt, m_Hour, m_ID, m_intDir, m_Lane, m_Length, m_Min, m_Month, m_NoAxles, m_Position, m_RoadPosition, m_Sec, m_Tdelay, m_Trns, m_Velocity, m_Year, setAS(), setAW(), setAxles(), and setID().
Referenced by Truck::createCASTORVehicle(), and CASTORFile::readLine().
00662 { 00663 m_Position = 0.0; 00664 m_RoadPosition = m_Position; 00665 00666 m_Head = atoi( data.substr(0,4).c_str() ); 00667 m_Day = atoi( data.substr(4,2).c_str() ); 00668 m_Month = atoi( data.substr(6,2).c_str() ); 00669 m_Year = atoi( data.substr(8,2).c_str() ); 00670 m_Hour = atoi( data.substr(10,2).c_str() ); 00671 m_Min = atoi( data.substr(12,2).c_str() ); 00672 m_Sec = atoi( data.substr(14,2).c_str() ); 00673 m_Hndt = atoi( data.substr(16,2).c_str() ); 00674 m_Velocity = atoi( data.substr(18,3).c_str() ); 00675 m_GVW = atoi( data.substr(21,4).c_str() ); 00676 m_Length = atoi( data.substr(25,3).c_str() ); 00677 m_NoAxles = atoi( data.substr(28,1).c_str() ); 00678 m_intDir = atoi( data.substr(29,1).c_str() ); 00679 m_Lane = atoi( data.substr(30,1).c_str() ); 00680 m_Trns = atoi( data.substr(31,3).c_str() ); 00681 00682 m_DirPos = m_intDir == 1 ? true : false; // Required for compatibility with legacy 00683 00684 // Length = length/10 for dm to meters 00685 // Vel = vel / 10 for dm/s to meters/second 00686 // GVW * 0.981 for kg/100 to kN 00687 // Trns = trns/10 for dm to meters 00688 00689 m_Length /= 10; 00690 m_Velocity /= 10; 00691 m_GVW *= KG100_TO_KN; 00692 m_Trns /= 10; 00693 00694 m_Tdelay = 0.0; 00695 00696 setAxles(); 00697 double W; 00698 double S; 00699 int j = 32; 00700 00701 for(int i = 0; i < m_NoAxles; i++) 00702 { 00703 j += 2; 00704 W = atoi( data.substr(j,3).c_str() ); 00705 W *= KG100_TO_KN; // convert to kN 00706 setAW(i, W); 00707 00708 j += 3; 00709 S = atoi( data.substr(j,2).c_str() ); 00710 S /= 10; // convert to m 00711 setAS(i, S); 00712 } 00713 00714 m_ID = setID(); 00715 }
void Vehicle::writeSAFTData | ( | char * | pVehChar | ) |
Prepares a vehicle for printing to a SAFT file.
pVehChar | The string of data to represent the truck |
Definition at line 839 of file Vehicle.cpp.
References getAS(), getAW(), KG100_TO_KN, m_Day, m_GVW, m_Head, m_Hndt, m_Hour, m_Length, m_Min, m_Month, m_NoAxles, m_Order, m_Sec, m_Velocity, m_Year, and Round().
Referenced by SAFTFile::writeLine().
00840 { 00841 // Length = length*10 for meters to decimeters 00842 // Vel = vel * 10 for metres/second to decimetres/second 00843 00844 int velocity = Round(m_Velocity*10); 00845 int length = Round(m_Length*10); 00846 00847 ostrstream oFile( pVehChar, sizeof(pVehChar)*78 ); 00848 00849 oFile.fill('0'); 00850 oFile.width(5); oFile << m_Order; 00851 oFile.width(5); oFile << m_Head; 00852 oFile.width(2); oFile << m_Day; 00853 oFile.width(2); oFile << m_Month; 00854 oFile.width(2); oFile << m_Year; 00855 oFile.width(2); oFile << m_Hour; 00856 oFile.width(2); oFile << m_Min; 00857 oFile.width(2); oFile << m_Sec; 00858 oFile.width(2); oFile << m_Hndt; 00859 oFile.fill(' '); 00860 oFile.width(3); oFile << velocity; 00861 oFile.width(4); oFile << m_GVW; 00862 oFile.width(3); oFile << length; 00863 oFile.width(1); oFile << m_NoAxles; 00864 00865 int j = 3; 00866 for(int i = 0; i < m_NoAxles; i++) 00867 { 00868 oFile.width(j); oFile << Round(this->getAW(i)/KG100_TO_KN); // convert from kN to kg/100 00869 j = 2; 00870 00871 if(i == m_NoAxles-1) 00872 break; 00873 00874 oFile.width(j); oFile << Round(this->getAS(i)*10); // convert from m to dm 00875 j = 3; 00876 } 00877 00878 oFile << ends; 00879 }
void Vehicle::writeCASTORData | ( | char * | pVehChar | ) |
Prepares a vehicle for printing to a CASTOR file.
pVehChar | The string of data to represent the truck |
Definition at line 776 of file Vehicle.cpp.
References CASTOR_MAX_AXLES, getAS(), getAW(), getLaneNoInDirection(), KG100_TO_KN, m_Day, m_GVW, m_Head, m_Hndt, m_Hour, m_intDir, m_Length, m_Min, m_Month, m_NoAxles, m_Sec, m_Trns, m_Velocity, m_Year, and Round().
Referenced by CASTORFile::writeLine().
00777 { 00778 // Length = length*10 for meters to decimeters 00779 // Vel = vel * 10 for metres/second to decimetres/second 00780 // GVW / 0.981 for KN to KG/100 00781 // Trns = trns/10 for metres to decimetres 00782 00783 int velocity = Round(m_Velocity*10); 00784 int grossWeight = Round(m_GVW/KG100_TO_KN); 00785 int length = Round(m_Length*10); 00786 int transPos = Round(m_Trns*10); 00787 00788 ostrstream oFile( pVehChar, sizeof(pVehChar)*78 ); 00789 00790 oFile.width(4); oFile << m_Head; 00791 oFile.width(2); oFile << m_Day; 00792 oFile.width(2); oFile << m_Month; 00793 oFile.width(2); oFile << m_Year; 00794 oFile.width(2); oFile << m_Hour; 00795 oFile.width(2); oFile << m_Min; 00796 oFile.width(2); oFile << m_Sec; 00797 oFile.width(2); oFile << m_Hndt; 00798 oFile.width(3); oFile << velocity; 00799 oFile.width(4); oFile << grossWeight; 00800 oFile.width(3); oFile << length; 00801 oFile.width(1); oFile << m_NoAxles; 00802 oFile.width(1); oFile << m_intDir; 00803 oFile.width(1); oFile << getLaneNoInDirection(); // local lane no in direction 00804 oFile.width(3); oFile << transPos; 00805 00806 int j = 3; 00807 for(int i = 0; i < m_NoAxles; i++) 00808 { 00809 oFile.width(j); oFile << Round(this->getAW(i)/KG100_TO_KN); // convert from kN to kg/100 00810 j = 2; 00811 00812 if(i == 8) break; 00813 00814 oFile.width(j); oFile << Round(this->getAS(i)*10); // convert from m to dm 00815 j = 3; 00816 } 00817 00818 for(i = m_NoAxles; i < CASTOR_MAX_AXLES; i++) 00819 { 00820 oFile.width(j); oFile << "0"; 00821 j = 2; 00822 00823 if(i == 8) break; 00824 00825 oFile.width(j); oFile << "0"; 00826 j = 3; 00827 } 00828 00829 oFile << ends; 00830 }
void Vehicle::updateProperties | ( | double | step, | |
double | accel | |||
) |
Updates the velocity, acceleration and position of the Vehicle based its acceleration and the timestep.
step | The timestep | |
accel | The Vehicle's acceleration |
Definition at line 127 of file Vehicle.cpp.
References m_Acceleration, m_Position, m_RoadPosition, and m_Velocity.
Referenced by update().
00128 { 00129 // Assume average velocity over timestep 00130 double v_old = m_Velocity; 00131 double v_new = m_Velocity + accel*step; 00132 00133 // zero speeds may occur when very close to stationary obstacle 00134 // eliminate as per Treiber's comments to Carpool Tunnel 00135 if(v_new < 0) 00136 { 00137 //TRACE("*** Backwards move prevented\n"); 00138 v_new = 0.0; 00139 } 00140 00141 m_Position += 0.5*(v_old + v_new)*step; 00142 00143 m_RoadPosition = m_Position; 00144 m_Velocity = v_new; 00145 00146 m_Acceleration = accel; 00147 }
void Vehicle::update | ( | double | step, | |
Vehicle * | pV | |||
) |
Updates the position of the Vehicle based on the timestep and preceding Vehicle.
step | the timestep | |
pV | a pointer to the Vehicle in front of this one |
Definition at line 70 of file Vehicle.cpp.
References calcAccel(), changeTime(), setChangeStatus(), and updateProperties().
00071 { 00072 bool change = changeTime(step); 00073 00074 if(change) 00075 setChangeStatus(true); 00076 00077 double accel = calcAccel(pV); 00078 00079 updateProperties(step, accel); 00080 }
void Vehicle::update | ( | double | step | ) |
Updates the position of the Vehicle based on the timestep.
step | the timestep |
Definition at line 49 of file Vehicle.cpp.
References calcAccel(), changeTime(), setChangeStatus(), and updateProperties().
00050 { 00051 if( changeTime(step) ) 00052 setChangeStatus(true); 00053 00054 double accel = calcAccel(); 00055 00056 updateProperties(step, accel); 00057 }
double Vehicle::calcAccel | ( | ) |
Calculates a Vehicle's acceleration when unimpeded by other Vehicles.
This function serves the purpose of determining the acceleration of a Vehicle when there are no other Vehicles in front of it in the same Lane. Based on the distance to the end of the Road, the DriverModel alters acceleration accordingly
Definition at line 88 of file Vehicle.cpp.
References m_pDriver, m_Position, m_RoadLength, m_Velocity, ROAD_END_BUFFER, DriverModel::setVel(), and DriverModel::update().
Referenced by LaneChangeAdvantage(), and update().
00089 { 00090 m_pDriver->setVel(m_Velocity); 00091 00092 //MAGIC NUMBER: ROAD END 00093 double accel = m_pDriver->update(m_Velocity, (m_RoadLength + ROAD_END_BUFFER) - m_Position); 00094 00095 return accel; 00096 }
bool Vehicle::changeTime | ( | double | step | ) |
Handles the timer for checking Lane changes.
step | The timestep |
Definition at line 154 of file Vehicle.cpp.
References m_Tdelay, and T_DELAY.
Referenced by update().
00155 { 00156 m_Tdelay += step; 00157 00158 if (m_Tdelay >= T_DELAY) 00159 { 00160 m_Tdelay = m_Tdelay - T_DELAY; 00161 return true; 00162 } 00163 else {return false;} 00164 }
double Vehicle::calcAccel | ( | Vehicle * | pV | ) |
Calculates a Vehicle's acceleration based on properties of the preceding Vehicle.
pV | A pointer to the preceding Vehicle |
Definition at line 106 of file Vehicle.cpp.
References getLength(), getPos(), getVelocity(), m_pDriver, m_Position, m_Velocity, DriverModel::setVel(), and DriverModel::update().
00107 { 00108 m_pDriver->setVel(m_Velocity); 00109 00110 double s = pV->getPos() - pV->getLength() - m_Position; 00111 00112 double delta_v = m_Velocity - pV->getVelocity(); 00113 double accel = m_pDriver->update(delta_v, s); 00114 00115 return accel; 00116 }
int Vehicle::DecideNextLane | ( | double | LeftAdv, | |
double | RightAdv | |||
) |
Referenced by Lane::ChangeLanes().
int Vehicle::DecideLaneChange | ( | Vehicle * | LeftFrontVehicle, | |
Vehicle * | LeftBackVehicle, | |||
Vehicle * | RightFrontVehicle, | |||
Vehicle * | RightBackVehicle, | |||
bool | LeftLaneExists, | |||
bool | RightLaneExists | |||
) |
Handles whether or not the Vehicle will change Lane.
LeftFrontVehicle | The Vehicle in front in the Left Lane | |
LeftBackVehicle | The Vehicle behind in the Left Lane | |
RightFrontVehicle | The Vehicle in front in the Right Lane | |
RightBackVehicle | The Vehicle behind in the Right Lane | |
LeftLaneExists | Whether or not there is a Lane to the left | |
RightLaneExists | Whether or not there is a Lane to the Right |
Definition at line 204 of file Vehicle.cpp.
References LaneChangeAdvantage(), and m_DriveOnRight.
00207 { 00208 // Note that a possible conflict between what is the lane's leftLane and rightLane 00209 // and the Vehicle's leftLane and Rightlane. For DirPos they are the same, but not 00210 // for DirNeg. e.g. 00211 // DirPos - Lane 1: leftLane = 2: rightLane = 0; 00212 // DirNeg - Lane 5: leftLane = 6: rightLane = 4 00213 // Whereas for the Vehicle: 00214 // DirPos - in lane 1: lane to left = 2: lane to right = 0; 00215 // DirNeg - in lane 5: lane to left = 4: lane to right = 6; 00216 // Therefore: 00217 // THIS FUNCTION NAMES LANES AS VIEWED BY THE VEHICLE 00218 00219 double LeftLaneAdvantage = 0.0; double RightLaneAdvantage = 0.0; 00220 00221 if(m_DriveOnRight) 00222 { // we are overtaking properly 00223 if(LeftLaneExists) 00224 LeftLaneAdvantage = LaneChangeAdvantage(LeftFrontVehicle, LeftBackVehicle, true); 00225 // or we are being bold 00226 if(RightLaneExists) 00227 RightLaneAdvantage = LaneChangeAdvantage(RightFrontVehicle, RightBackVehicle, false); 00228 } 00229 else 00230 { // we're boldly undertaking 00231 if(LeftLaneExists) 00232 LeftLaneAdvantage = LaneChangeAdvantage(LeftFrontVehicle, LeftBackVehicle, false); 00233 // we are overtaking properly 00234 if(RightLaneExists) 00235 RightLaneAdvantage = LaneChangeAdvantage(RightFrontVehicle, RightBackVehicle, true); 00236 } 00237 00238 const double zero = 0.0001; 00239 if(LeftLaneAdvantage < zero && RightLaneAdvantage < zero) 00240 return 0; // do not change lane 00241 else if(LeftLaneAdvantage > RightLaneAdvantage) 00242 return 1; // move to the left lane 00243 else 00244 return 2; // move to the right lane 00245 }
int Vehicle::Round | ( | double | val | ) | [inline, protected] |
WORD Vehicle::setID | ( | ) | [protected] |
Definition at line 482 of file Vehicle.cpp.
References CRANE_AVERAGE_SPACING, getAS(), LOWLOADER_MIN_MAX_SPACING, m_ID, m_NoAxles, m_vAxles, SMALL_TRUCK_NO_AXLES, VEH_ID_CRANE, VEH_ID_LARGETRUCK, VEH_ID_LOWLOADER, and VEH_ID_SMALLTRUCK.
Referenced by createCASTORVehicle(), and createSAFTVehicle().
00483 { 00484 // Small Truck or large truck 00485 m_ID = (m_NoAxles <= SMALL_TRUCK_NO_AXLES) ? 00486 VEH_ID_SMALLTRUCK : VEH_ID_LARGETRUCK; 00487 00488 00489 double averageSpace = getAS(0); 00490 double maxSpace = 0; 00491 00492 // For all the vehicle's axles 00493 for(int i = 1; i < m_NoAxles; i++) 00494 { 00495 // Obtain the average spacing 00496 averageSpace += getAS(i); 00497 00498 // Obtain the maximum spacing 00499 if(getAS(i) > getAS(i-1)) 00500 maxSpace = getAS(i); 00501 } 00502 00503 // If the maximum spacing is less than the maximum spacing for a crane and there are more than 2 axles 00504 if(maxSpace < CRANE_MAX_SPACING && m_NoAxles > 2) 00505 { 00506 if(averageSpace / m_vAxles.size() < CRANE_AVERAGE_SPACING) // And the average spacing is less than the maximum average for a crane 00507 m_ID = VEH_ID_CRANE; // It is a crane 00508 } 00509 00510 // If the maximum spacing is at least the maximum for a low-loader and there are more than 2 axles 00511 if(maxSpace >= LOWLOADER_MIN_MAX_SPACING && m_NoAxles > 2) 00512 m_ID = VEH_ID_LOWLOADER; //It is a low-loader 00513 00514 return m_ID; 00515 }
double Vehicle::LaneChangeAdvantage | ( | Vehicle * | FrontVehicle, | |
Vehicle * | BackVehicle, | |||
bool | overtake | |||
) | [protected] |
Gets the advantage a Vehicle would gain from switching Lanes.
FrontVehicle | The Vehicle in front in the new Lane | |
BackVehicle | The Vehicle behind in the new Lane | |
overtake | Whether the Vehicle is overtaking or undertaking |
Definition at line 260 of file Vehicle.cpp.
References calcAccel(), getAccel(), getLength(), getPos(), DriverModel::LaneChange(), m_pDriver, MIN_SPACE_FOR_NEXT_VEHICLE, and SAFE_BRAKING.
Referenced by DecideLaneChange().
00261 { 00262 // These are IDM properties and may be reomved from Constants.h 00263 double GapToFront = MIN_SPACE_FOR_NEXT_VEHICLE; double GapToBack = MIN_SPACE_FOR_NEXT_VEHICLE; 00264 double CurrentBackAccel = SAFE_BRAKING; double ProposedBackAccel= SAFE_BRAKING; 00265 double FrontChangeAccel = 0.0; 00266 00267 // calculate the above lane change parameters 00268 if(FrontVehicle != NULL) 00269 { 00270 GapToFront = FrontVehicle->getPos() - FrontVehicle->getLength() - this->getPos(); 00271 FrontChangeAccel = this->calcAccel(FrontVehicle) - this->getAccel(); 00272 } 00273 else 00274 FrontChangeAccel = this->calcAccel() - this->getAccel(); // no front Vehicle 00275 00276 if(BackVehicle != NULL) 00277 { 00278 GapToBack = this->getPos() - this->getLength() - BackVehicle->getPos(); 00279 ProposedBackAccel = BackVehicle->calcAccel(this); 00280 // Since the acceleration of the back Vehicle at the next step 00281 // is affected by the presence of the Vehicle in front of it 00282 // we must take that into account and not an open-road acceleration 00283 // but only if there is a Vehicle in front! 00284 if(FrontVehicle != NULL) 00285 CurrentBackAccel = BackVehicle->calcAccel(FrontVehicle); 00286 else 00287 CurrentBackAccel = BackVehicle->getAccel(); 00288 } 00289 00290 double advantage = m_pDriver->LaneChange(GapToFront, GapToBack, FrontChangeAccel, 00291 CurrentBackAccel, ProposedBackAccel, overtake); 00292 return advantage; 00293 }
DriverModel* Vehicle::m_pDriver [protected] |
Definition at line 91 of file Vehicle.h.
Referenced by calcAccel(), getDataString(), getDesiredVel(), getDriver(), LaneChangeAdvantage(), and setDriver().
IDM Vehicle::m_IDMDriver [protected] |
bool Vehicle::m_DriveOnRight [protected] |
bool Vehicle::m_DirPos [protected] |
Definition at line 95 of file Vehicle.h.
Referenced by createCASTORVehicle(), getDataString(), getDirection(), getLaneNoInDirection(), and setDirection().
int Vehicle::m_intDir [protected] |
Definition at line 96 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), Truck::returnTruckData(), and writeCASTORData().
int Vehicle::m_Lane [protected] |
Definition at line 97 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getDataString(), getLane(), getLaneNoInDirection(), Truck::returnTruckData(), and setLane().
int Vehicle::m_RoadLength [protected] |
double Vehicle::m_Position [protected] |
Definition at line 99 of file Vehicle.h.
Referenced by calcAccel(), createCASTORVehicle(), createSAFTVehicle(), getPos(), setPos(), and updateProperties().
double Vehicle::m_RoadPosition [protected] |
Definition at line 100 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getDataString(), getRoadPos(), setRoadPos(), and updateProperties().
double Vehicle::m_Velocity [protected] |
Definition at line 102 of file Vehicle.h.
Referenced by calcAccel(), createCASTORVehicle(), createSAFTVehicle(), getDataString(), getVelocity(), Truck::returnTruckData(), setVelocity(), updateProperties(), writeCASTORData(), and writeSAFTData().
double Vehicle::m_Acceleration [protected] |
Definition at line 103 of file Vehicle.h.
Referenced by getAccel(), getDataString(), setAccel(), and updateProperties().
int Vehicle::m_Order [protected] |
int Vehicle::m_Head [protected] |
Definition at line 106 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), Truck::returnTruckData(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Year [protected] |
Definition at line 108 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Month [protected] |
Definition at line 109 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Day [protected] |
Definition at line 110 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Hour [protected] |
Definition at line 111 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Min [protected] |
Definition at line 112 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Sec [protected] |
Definition at line 113 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Hndt [protected] |
Definition at line 114 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getTime(), Truck::returnTruckData(), setTime(), writeCASTORData(), and writeSAFTData().
double Vehicle::m_GVW [protected] |
Definition at line 116 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getDataString(), getGVW(), Truck::returnTruckData(), setGVW(), writeCASTORData(), and writeSAFTData().
int Vehicle::m_Trns [protected] |
Definition at line 117 of file Vehicle.h.
Referenced by createCASTORVehicle(), Truck::returnTruckData(), and writeCASTORData().
int Vehicle::m_NoAxles [protected] |
Definition at line 118 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getDataString(), getNoAxles(), Truck::returnTruckData(), setAxles(), setID(), writeCASTORData(), and writeSAFTData().
double Vehicle::m_Length [protected] |
Definition at line 119 of file Vehicle.h.
Referenced by createCASTORVehicle(), createSAFTVehicle(), getDataString(), getLength(), Truck::returnTruckData(), setLength(), writeCASTORData(), and writeSAFTData().
std::vector<Axle*> Vehicle::m_vAxles [protected] |
Definition at line 120 of file Vehicle.h.
Referenced by getAS(), getAW(), setAS(), setAW(), setAxles(), setID(), Car::~Car(), and Truck::~Truck().
WORD Vehicle::m_ID [protected] |
Definition at line 122 of file Vehicle.h.
Referenced by Car::Car(), createCASTORVehicle(), createSAFTVehicle(), getID(), and setID().
bool Vehicle::m_bLaneChange [protected] |
double Vehicle::m_Tdelay [protected] |
Definition at line 124 of file Vehicle.h.
Referenced by Car::Car(), changeTime(), createCASTORVehicle(), and createSAFTVehicle().
int Vehicle::m_TotalNoLanesInRoad [protected] |
Definition at line 125 of file Vehicle.h.
Referenced by getLaneNoInDirection(), and setTotalNoLanesInRoad().
int Vehicle::ROAD_END_BUFFER [protected] |
double Vehicle::T_DELAY [protected] |
double Vehicle::MIN_SPACE_FOR_NEXT_VEHICLE [protected] |
double Vehicle::SAFE_BRAKING [protected] |
double Vehicle::CRANE_AVERAGE_SPACING [protected] |
double Vehicle::CRANE_MAX_SPACING [protected] |
double Vehicle::LOWLOADER_MIN_MAX_SPACING [protected] |
int Vehicle::SMALL_TRUCK_NO_AXLES [protected] |
int Vehicle::DAYS_PER_MT [protected] |
int Vehicle::MTS_PER_YR [protected] |