#include <MSCalibrator.h>

Classes which realise different schemes to emit vehicles (file-based, based on user entries on the gui, etc.) should subclass this class
Definition at line 84 of file MSCalibrator.h.
Public Member Functions | |
| SUMOReal | computeOffset (SUMOReal flow) const |
| Returns the time offset till the next vehicle emission for a given flow. | |
| const std::vector< const MSRoute * > & | getAllRoutes () const |
| Returns a list of all available routes. | |
| const MSRoute * | getRndRoute () const |
| Returns a random route. | |
| MSVehicleType * | getRndVType () const |
| Returns a random type. | |
| RandomDistributor< const MSRoute * > & | getRouteDist () |
| Returns the routes probability. | |
| bool | hasRoutes () const |
| Returns the information whether any route is stored. | |
| bool | hasVTypes () const |
| Returns the information whether any vehicle type is stored. | |
| MSCalibratorChild (MSCalibrator &parent, MSVehicleControl &vc) | |
| Constructor. | |
| virtual | ~MSCalibratorChild () |
| Destructor. | |
Protected Attributes | |
| MSCalibrator & | myParent |
| The calibrator this instance is child of. | |
| RandomDistributor< const MSRoute * > | myRouteDist |
| The used route probability distribution. | |
| SUMOReal | myTimeOffset |
| The time offset till next emission. | |
| MSVehicleControl & | myVehicleControl |
| The vehicle control to use for vehicle building. | |
| RandomDistributor < MSVehicleType * > | myVTypeDist |
| The used vehicle type probability distribution. | |
Private Member Functions | |
| MSCalibratorChild (const MSCalibratorChild &) | |
| Invalidated copy constructor. | |
| MSCalibratorChild & | operator= (const MSCalibratorChild &) |
| Invalidated assignment operator. | |
| MSCalibrator::MSCalibratorChild::MSCalibratorChild | ( | MSCalibrator & | parent, | |
| MSVehicleControl & | vc | |||
| ) | [inline] |
Constructor.
Definition at line 87 of file MSCalibrator.h.
00088 : myParent(parent), myVehicleControl(vc), myTimeOffset(0) { }
| virtual MSCalibrator::MSCalibratorChild::~MSCalibratorChild | ( | ) | [inline, virtual] |
| MSCalibrator::MSCalibratorChild::MSCalibratorChild | ( | const MSCalibratorChild & | ) | [private] |
Invalidated copy constructor.
| SUMOReal MSCalibrator::MSCalibratorChild::computeOffset | ( | SUMOReal | flow | ) | const [inline] |
Returns the time offset till the next vehicle emission for a given flow.
Definition at line 119 of file MSCalibrator.h.
References myTimeOffset, and SUMOReal.
Referenced by MSCalibrator::MSCalibrator_FileTriggeredChild::execute().
00119 { 00120 SUMOReal freq = (SUMOReal)(1. / (flow / 3600.)); 00121 SUMOReal ret = freq; 00122 myTimeOffset += (freq - (SUMOTime) ret); 00123 if (myTimeOffset>1) { 00124 myTimeOffset -= 1; 00125 ret += 1; 00126 } 00127 if (ret==0) { // !!! check what to do in this case (more than one vehicle/s) 00128 ret = 1; 00129 } 00130 return ret; 00131 }
| const std::vector<const MSRoute*>& MSCalibrator::MSCalibratorChild::getAllRoutes | ( | ) | const [inline] |
Returns a list of all available routes.
Definition at line 99 of file MSCalibrator.h.
References RandomDistributor< T >::getVals(), and myRouteDist.
00099 { 00100 return myRouteDist.getVals(); 00101 }
| const MSRoute* MSCalibrator::MSCalibratorChild::getRndRoute | ( | ) | const [inline] |
Returns a random route.
Definition at line 94 of file MSCalibrator.h.
References RandomDistributor< T >::get(), and myRouteDist.
00094 { 00095 return myRouteDist.get(); 00096 }
| MSVehicleType* MSCalibrator::MSCalibratorChild::getRndVType | ( | ) | const [inline] |
Returns a random type.
Definition at line 104 of file MSCalibrator.h.
References RandomDistributor< T >::get(), and myVTypeDist.
00104 { 00105 return myVTypeDist.get(); 00106 }
| RandomDistributor<const MSRoute*>& MSCalibrator::MSCalibratorChild::getRouteDist | ( | ) | [inline] |
Returns the routes probability.
Definition at line 134 of file MSCalibrator.h.
References myRouteDist.
00134 { 00135 return myRouteDist; 00136 }
| bool MSCalibrator::MSCalibratorChild::hasRoutes | ( | ) | const [inline] |
Returns the information whether any route is stored.
Definition at line 109 of file MSCalibrator.h.
References RandomDistributor< T >::getOverallProb(), and myRouteDist.
00109 { 00110 return myRouteDist.getOverallProb()!=0; 00111 }
| bool MSCalibrator::MSCalibratorChild::hasVTypes | ( | ) | const [inline] |
Returns the information whether any vehicle type is stored.
Definition at line 114 of file MSCalibrator.h.
References RandomDistributor< T >::getOverallProb(), and myVTypeDist.
00114 { 00115 return myVTypeDist.getOverallProb()!=0; 00116 }
| MSCalibratorChild& MSCalibrator::MSCalibratorChild::operator= | ( | const MSCalibratorChild & | ) | [private] |
Invalidated assignment operator.
MSCalibrator& MSCalibrator::MSCalibratorChild::myParent [protected] |
The calibrator this instance is child of.
Definition at line 140 of file MSCalibrator.h.
Referenced by MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSCalibrator::MSCalibrator_FileTriggeredChild::execute(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), and MSCalibrator::MSCalibrator_FileTriggeredChild::processNextEntryReaderTriggered().
RandomDistributor<const MSRoute*> MSCalibrator::MSCalibratorChild::myRouteDist [protected] |
The used route probability distribution.
Definition at line 146 of file MSCalibrator.h.
Referenced by MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), getAllRoutes(), getRndRoute(), getRouteDist(), hasRoutes(), and MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement().
SUMOReal MSCalibrator::MSCalibratorChild::myTimeOffset [mutable, protected] |
The time offset till next emission.
Definition at line 152 of file MSCalibrator.h.
Referenced by computeOffset().
The vehicle control to use for vehicle building.
Definition at line 143 of file MSCalibrator.h.
Referenced by MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement().
The used vehicle type probability distribution.
Definition at line 149 of file MSCalibrator.h.
Referenced by MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), getRndVType(), hasVTypes(), and MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement().
1.5.6