![]() |
SUMO - Simulation of Urban MObility
|
The class responsible for building and deletion of vehicles. More...
#include <MSVehicleControl.h>
Public Types | |
typedef std::map< std::string, SUMOVehicle * >::const_iterator | constVehIt |
Definition of the internal vehicles map iterator. More... | |
Public Member Functions | |
void | abortWaiting () |
informes about all waiting vehicles (deletion in destructor) More... | |
void | adaptIntermodalRouter (MSNet::MSIntermodalRouter &router) const |
void | addWaiting (const MSEdge *const edge, SUMOVehicle *vehicle) |
Adds a vehicle to the list of waiting vehiclse to a given edge. More... | |
SUMOTime | computeRandomDepartOffset () const |
compute (optional) random offset to the departure time More... | |
void | discountStateLoaded (bool removed=false) |
avoid counting a vehicle twice if it was loaded from state and route input More... | |
double | getMaxSpeedFactor () const |
return the maximum speed factor for all vehicles that ever entered the network More... | |
double | getMinDeceleration () const |
return the minimum deceleration capability for all vehicles that ever entered the network More... | |
SUMOVehicle * | getWaitingVehicle (const MSEdge *const edge, const std::set< std::string > &lines, const double position, const std::string ridingID) |
MSVehicleControl () | |
Constructor. More... | |
void | registerCollision () |
registers one collision-related teleport More... | |
void | registerEmergencyStop () |
register emergency stop More... | |
void | registerOneWaiting (const bool isPerson) |
increases the count of vehicles waiting for a transport to allow recognition of person / container related deadlocks More... | |
void | registerTeleportJam () |
register one non-collision-related teleport More... | |
void | registerTeleportWrongLane () |
register one non-collision-related teleport More... | |
void | registerTeleportYield () |
register one non-collision-related teleport More... | |
void | removeWaiting (const MSEdge *const edge, SUMOVehicle *vehicle) |
Removes a vehicle from the list of waiting vehicles to a given edge. More... | |
void | unregisterOneWaiting (const bool isPerson) |
decreases the count of vehicles waiting for a transport to allow recognition of person / container related deadlocks More... | |
virtual | ~MSVehicleControl () |
Destructor. More... | |
Vehicle creation | |
virtual SUMOVehicle * | buildVehicle (SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true) |
Builds a vehicle, increases the number of built vehicles. More... | |
Insertion, deletion and retrieval of vehicles | |
virtual bool | addVehicle (const std::string &id, SUMOVehicle *v) |
Tries to insert the vehicle into the internal vehicle container. More... | |
SUMOVehicle * | getVehicle (const std::string &id) const |
Returns the vehicle with the given id. More... | |
virtual void | deleteVehicle (SUMOVehicle *v, bool discard=false) |
Deletes the vehicle. More... | |
void | scheduleVehicleRemoval (SUMOVehicle *veh) |
Removes a vehicle after it has ended. More... | |
constVehIt | loadedVehBegin () const |
Returns the begin of the internal vehicle map. More... | |
constVehIt | loadedVehEnd () const |
Returns the end of the internal vehicle map. More... | |
Setting vehicle statistics | |
void | vehicleDeparted (const SUMOVehicle &v) |
Informs this control about a vehicle's departure. More... | |
Retrieval of vehicle statistics (always accessable) | |
int | getLoadedVehicleNo () const |
Returns the number of build vehicles. More... | |
int | getEndedVehicleNo () const |
Returns the number of removed vehicles. More... | |
int | getRunningVehicleNo () const |
Returns the number of build and inserted, but not yet deleted vehicles. More... | |
int | getDepartedVehicleNo () const |
Returns the number of inserted vehicles. More... | |
int | getQuota (double frac=-1) const |
Returns the number of instances of the current vehicle that shall be emitted considering that "frac" of all vehicles shall be emitted overall if a negative fraction is given the demand scaling factor is used (–scale) More... | |
int | getActiveVehicleCount () const |
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a container. More... | |
int | getCollisionCount () const |
return the number of collisions More... | |
int | getTeleportsJam () const |
return the number of teleports due to jamming More... | |
int | getTeleportsYield () const |
return the number of teleports due to vehicles stuck on a minor road More... | |
int | getTeleportsWrongLane () const |
return the number of teleports due to vehicles stuck on the wrong lane More... | |
int | getTeleportCount () const |
return the number of teleports (including collisions) More... | |
int | getEmergencyStops () const |
return the number of emergency stops More... | |
double | getTotalDepartureDelay () const |
Returns the total departure delay. More... | |
double | getTotalTravelTime () const |
Returns the total travel time. More... | |
Insertion and retrieval of vehicle types | |
bool | addVType (MSVehicleType *vehType) |
Adds a vehicle type. More... | |
void | removeVType (const MSVehicleType *vehType) |
bool | addVTypeDistribution (const std::string &id, RandomDistributor< MSVehicleType *> *vehTypeDistribution) |
Adds a vehicle type distribution. More... | |
bool | hasVType (const std::string &id) const |
Asks for existence of a vehicle type. More... | |
bool | hasVTypeDistribution (const std::string &id) const |
Asks for a vehicle type distribution. More... | |
MSVehicleType * | getVType (const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=0) |
Returns the named vehicle type or a sample from the named distribution. More... | |
void | insertVTypeIDs (std::vector< std::string > &into) const |
Inserts ids of all known vehicle types and vehicle type distributions to the given vector. More... | |
State I/O | |
void | setState (int runningVehNo, int loadedVehNo, int endedVehNo, double totalDepartureDelay, double totalTravelTime) |
Sets the current state variables as loaded from the stream. More... | |
void | saveState (OutputDevice &out) |
Saves the current state into the given stream. More... | |
Private Member Functions | |
bool | checkVType (const std::string &id) |
Checks whether the vehicle type (distribution) may be added. More... | |
Private Attributes | |
Vehicle statistics | |
double | myTotalDepartureDelay |
The aggregated time vehicles had to wait for departure (in seconds) More... | |
double | myTotalTravelTime |
The aggregated time vehicles needed to aacomplish their route (in seconds) More... | |
Vehicle statistics (always accessible) | |
int | myLoadedVehNo |
The number of build vehicles. More... | |
int | myRunningVehNo |
The number of vehicles within the network (build and inserted but not removed) More... | |
int | myEndedVehNo |
The number of removed vehicles. More... | |
int | myDiscarded |
The number of vehicles which were discarded while loading. More... | |
int | myCollisions |
The number of collisions. More... | |
int | myTeleportsJam |
The number of teleports due to jam. More... | |
int | myTeleportsYield |
The number of teleports due to vehicles stuck on a minor road. More... | |
int | myTeleportsWrongLane |
The number of teleports due to vehicles stuck on the wrong lane. More... | |
int | myEmergencyStops |
The number of emergency stops. More... | |
Vehicle container | |
typedef std::map< std::string, SUMOVehicle *> | VehicleDictType |
Vehicle dictionary type. More... | |
VehicleDictType | myVehicleDict |
Dictionary of vehicles. More... | |
Vehicle type container | |
typedef std::map< std::string, MSVehicleType *> | VTypeDictType |
Vehicle type dictionary type. More... | |
typedef std::map< std::string, RandomDistributor< MSVehicleType * > *> | VTypeDistDictType |
Vehicle type distribution dictionary type. More... | |
VTypeDictType | myVTypeDict |
Dictionary of vehicle types. More... | |
VTypeDistDictType | myVTypeDistDict |
A distribution of vehicle types (probability->vehicle type) More... | |
bool | myDefaultVTypeMayBeDeleted |
Whether no vehicle type was loaded. More... | |
bool | myDefaultPedTypeMayBeDeleted |
Whether no pedestrian type was loaded. More... | |
std::map< const MSEdge *const, std::vector< SUMOVehicle * > > | myWaiting |
the lists of waiting vehicles to a given edge More... | |
int | myWaitingForPerson |
the number of vehicles wainting for persons contained in myWaiting which can only continue by being triggered More... | |
int | myWaitingForContainer |
the number of vehicles wainting for containers contained in myWaiting which can only continue by being triggered More... | |
double | myScale |
The scaling factor (especially for inc-dua) More... | |
SUMOTime | myMaxRandomDepartOffset |
The maximum random offset to be added to vehicles departure times (non-negative) More... | |
double | myMaxSpeedFactor |
The maximum speed factor for all vehicles in the network. More... | |
double | myMinDeceleration |
The minimum deceleration capability for all vehicles in the network. More... | |
std::vector< SUMOVehicle * > | myPTVehicles |
List of vehicles which belong to public transport. More... | |
MSVehicleControl (const MSVehicleControl &s) | |
invalidated copy constructor More... | |
MSVehicleControl & | operator= (const MSVehicleControl &s) |
invalidated assignment operator More... | |
The class responsible for building and deletion of vehicles.
This class is responsible for vehicle building and deletion. It stores vehicle types, vehicles and statistics about the last.
This class also realizes the tripinfos and the vehroutes - outputs, both generated when a vehicle is removed from the simulation, see scheduleVehicleRemoval.
Use this class for the pure microsim and GUIVehicleControl within the gui.
Definition at line 74 of file MSVehicleControl.h.
typedef std::map<std::string, SUMOVehicle*>::const_iterator MSVehicleControl::constVehIt |
Definition of the internal vehicles map iterator.
Definition at line 77 of file MSVehicleControl.h.
|
protected |
Vehicle dictionary type.
Definition at line 531 of file MSVehicleControl.h.
|
private |
Vehicle type dictionary type.
Definition at line 542 of file MSVehicleControl.h.
|
private |
Vehicle type distribution dictionary type.
Definition at line 547 of file MSVehicleControl.h.
MSVehicleControl::MSVehicleControl | ( | ) |
Constructor.
Definition at line 50 of file MSVehicleControl.cpp.
References MSVehicleType::build(), DEFAULT_PEDTYPE_ID, DEFAULT_VTYPE_ID, OptionsCont::getFloat(), OptionsCont::getOptions(), OptionsCont::getString(), myMaxRandomDepartOffset, myScale, myVTypeDict, SUMOVTypeParameter::parametersSet, string2time(), SVC_PASSENGER, SVC_PEDESTRIAN, and VTYPEPARS_VEHICLECLASS_SET.
|
virtual |
Destructor.
Definition at line 79 of file MSVehicleControl.cpp.
References myVehicleDict, myVTypeDict, and myVTypeDistDict.
|
private |
invalidated copy constructor
void MSVehicleControl::abortWaiting | ( | ) |
informes about all waiting vehicles (deletion in destructor)
Definition at line 386 of file MSVehicleControl.cpp.
References myVehicleDict, and WRITE_WARNING.
Referenced by discountStateLoaded(), and MSNet::simulationState().
void MSVehicleControl::adaptIntermodalRouter | ( | MSNet::MSIntermodalRouter & | router | ) | const |
Definition at line 418 of file MSVehicleControl.cpp.
References IntermodalRouter< E, L, N, V, INTERNALROUTER >::addSchedule(), and myPTVehicles.
Referenced by MSNet::adaptIntermodalRouter(), and getMinDeceleration().
|
virtual |
Tries to insert the vehicle into the internal vehicle container.
Checks whether another vehicle with the same id exists; returns false if so. Otherwise, the vehicle is added to "myVehicleDict". It also checks whether the vehicle has a "triggered" departure and registers it accordingly.
The vehicle control gets responsible for vehicle deletion.
[in] | id | The id of the vehicle |
[in] | v | The vehicle |
Reimplemented in GUIVehicleControl, and GUIMEVehicleControl.
Definition at line 188 of file MSVehicleControl.cpp.
References addWaiting(), DEPART_CONTAINER_TRIGGERED, DEPART_TRIGGERED, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departProcedure, MSRoute::getEdges(), MSEdge::getLanes(), SUMOVehicle::getParameter(), SUMOVehicle::getRoute(), MSGlobals::gUseMesoSim, SUMOVehicleParameter::line, myPTVehicles, myVehicleDict, registerOneWaiting(), and SUMOVehicleParameter::repetitionNumber.
Referenced by libsumo::Vehicle::add(), MSRouteHandler::addPersonTrip(), GUIMEVehicleControl::addVehicle(), GUIVehicleControl::addVehicle(), MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), MSCalibrator::execute(), TraCIServerAPI_Vehicle::processSet(), and METriggeredCalibrator::tryEmit().
bool MSVehicleControl::addVType | ( | MSVehicleType * | vehType | ) |
Adds a vehicle type.
If another vehicle type (or distribution) with the same id exists, false is returned. Otherwise, the vehicle type is added to the internal vehicle type container "myVTypeDict".
This control get responsible for deletion of the added vehicle type.
[in] | vehType | The vehicle type to add |
Definition at line 262 of file MSVehicleControl.cpp.
References checkVType(), MSVehicleType::getID(), and myVTypeDict.
Referenced by getTotalTravelTime().
bool MSVehicleControl::addVTypeDistribution | ( | const std::string & | id, |
RandomDistributor< MSVehicleType *> * | vehTypeDistribution | ||
) |
Adds a vehicle type distribution.
If another vehicle type (or distribution) with the same id exists, false is returned. Otherwise, the vehicle type distribution is added to the internal vehicle type distribution container "myVTypeDistDict".
This control get responsible for deletion of the added vehicle type distribution.
[in] | id | The id of the distribution to add |
[in] | vehTypeDistribution | The vehicle type distribution to add |
Definition at line 281 of file MSVehicleControl.cpp.
References checkVType(), and myVTypeDistDict.
Referenced by getTotalTravelTime().
void MSVehicleControl::addWaiting | ( | const MSEdge *const | edge, |
SUMOVehicle * | vehicle | ||
) |
Adds a vehicle to the list of waiting vehiclse to a given edge.
Definition at line 334 of file MSVehicleControl.cpp.
References myWaiting.
Referenced by addVehicle(), getTotalTravelTime(), and MSVehicle::processNextStop().
|
virtual |
Builds a vehicle, increases the number of built vehicles.
Builds a MSVehicle instance using the given parameter. Increases the number of loaded vehicles ("myLoadedVehNo").
[in] | defs | The parameter defining the vehicle |
[in] | route | The route of this vehicle |
[in] | type | The type of this vehicle |
[in] | ignoreStopErrors | whether invalid stops trigger a warning only |
[in] | fromRouteFile | whether we are just reading the route file or creating via trigger, traci, ... |
Reimplemented in GUIVehicleControl, GUIMEVehicleControl, and MEVehicleControl.
Definition at line 108 of file MSVehicleControl.cpp.
References MSBaseVehicle::addStops(), MSVehicleType::computeChosenSpeedDeviation(), computeRandomDepartOffset(), SUMOVehicleParameter::depart, MSNet::getInstance(), MSRouteHandler::getParsingRNG(), MSNet::informVehicleStateListener(), myLoadedVehNo, and MSNet::VEHICLE_STATE_BUILT.
Referenced by libsumo::Vehicle::add(), MSRouteHandler::addPersonTrip(), MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), METriggeredCalibrator::execute(), MSCalibrator::execute(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), and TraCIServerAPI_Vehicle::processSet().
|
private |
Checks whether the vehicle type (distribution) may be added.
This method checks also whether the default type may still be replaced
[in] | id | The id of the vehicle type (distribution) to add |
Definition at line 236 of file MSVehicleControl.cpp.
References DEFAULT_PEDTYPE_ID, DEFAULT_VTYPE_ID, myDefaultPedTypeMayBeDeleted, myDefaultVTypeMayBeDeleted, myVTypeDict, and myVTypeDistDict.
Referenced by addVType(), addVTypeDistribution(), and getMinDeceleration().
SUMOTime MSVehicleControl::computeRandomDepartOffset | ( | ) | const |
compute (optional) random offset to the departure time
Definition at line 98 of file MSVehicleControl.cpp.
References DELTA_T, MSRouteHandler::getParsingRNG(), myMaxRandomDepartOffset, and RandHelper::rand().
Referenced by MEVehicleControl::buildVehicle(), GUIMEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), buildVehicle(), and discountStateLoaded().
|
virtual |
Deletes the vehicle.
[in] | v | The vehicle to delete |
Reimplemented in GUIVehicleControl, and GUIMEVehicleControl.
Definition at line 223 of file MSVehicleControl.cpp.
References SUMOVehicle::getID(), myDiscarded, myEndedVehNo, and myVehicleDict.
Referenced by MSRouteHandler::addPersonTrip(), MSInsertionControl::clearPendingVehicles(), MSRouteHandler::closeVehicle(), GUIMEVehicleControl::deleteVehicle(), GUIVehicleControl::deleteVehicle(), MSInsertionControl::determineCandidates(), METriggeredCalibrator::execute(), MSCalibrator::execute(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), TraCIServerAPI_Vehicle::processSet(), scheduleVehicleRemoval(), and MSInsertionControl::tryInsert().
|
inline |
avoid counting a vehicle twice if it was loaded from state and route input
Definition at line 441 of file MSVehicleControl.h.
References abortWaiting(), computeRandomDepartOffset(), myDiscarded, myEndedVehNo, myLoadedVehNo, and myRunningVehNo.
Referenced by MSStateHandler::closeVehicle(), and MSInsertionControl::determineCandidates().
|
inline |
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a container.
Definition at line 244 of file MSVehicleControl.h.
References myEndedVehNo, myLoadedVehNo, myWaitingForContainer, and myWaitingForPerson.
Referenced by libsumo::Simulation::getMinExpectedNumber(), and MSNet::simulationState().
|
inline |
return the number of collisions
Definition at line 250 of file MSVehicleControl.h.
References myCollisions.
Referenced by GUIApplicationWindow::checkGamingEvents(), MSNet::closeSimulation(), and GUINet::getParameterWindow().
|
inline |
Returns the number of inserted vehicles.
Definition at line 226 of file MSVehicleControl.h.
References getQuota(), myDiscarded, myEndedVehNo, and myRunningVehNo.
Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), MSNet::postSimStepOutput(), and MSNet::writeOutput().
|
inline |
return the number of emergency stops
Definition at line 273 of file MSVehicleControl.h.
References myEmergencyStops.
Referenced by MSNet::closeSimulation().
|
inline |
Returns the number of removed vehicles.
Definition at line 210 of file MSVehicleControl.h.
References myEndedVehNo.
Referenced by GUINet::getParameterWindow(), and MSNet::writeOutput().
|
inline |
Returns the number of build vehicles.
Definition at line 202 of file MSVehicleControl.h.
References myLoadedVehNo.
Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), and MSNet::writeOutput().
|
inline |
return the maximum speed factor for all vehicles that ever entered the network
Definition at line 460 of file MSVehicleControl.h.
References myMaxSpeedFactor.
Referenced by MSLane::getMaximumBrakeDist().
|
inline |
return the minimum deceleration capability for all vehicles that ever entered the network
Definition at line 465 of file MSVehicleControl.h.
References adaptIntermodalRouter(), checkVType(), and myMinDeceleration.
Referenced by MSLane::getMaximumBrakeDist().
int MSVehicleControl::getQuota | ( | double | frac = -1 | ) | const |
Returns the number of instances of the current vehicle that shall be emitted considering that "frac" of all vehicles shall be emitted overall if a negative fraction is given the demand scaling factor is used (–scale)
Definition at line 394 of file MSVehicleControl.cpp.
References myLoadedVehNo, and myScale.
Referenced by MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), MSDevice::equippedByDefaultAssignmentOptions(), and getDepartedVehicleNo().
|
inline |
Returns the number of build and inserted, but not yet deleted vehicles.
Definition at line 218 of file MSVehicleControl.h.
References myRunningVehNo.
Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), GUIApplicationWindow::handleEvent_SimulationStep(), MSNet::postSimStepOutput(), GUINet::setSimDuration(), MSNet::simulationStep(), and MSNet::writeOutput().
int MSVehicleControl::getTeleportCount | ( | ) | const |
return the number of teleports (including collisions)
Definition at line 412 of file MSVehicleControl.cpp.
References myCollisions, myTeleportsJam, myTeleportsWrongLane, myTeleportsYield, and MSLane::teleportOnCollision().
Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), getTeleportsWrongLane(), and MSNet::simulationState().
|
inline |
return the number of teleports due to jamming
Definition at line 255 of file MSVehicleControl.h.
References myTeleportsJam.
Referenced by MSNet::closeSimulation().
|
inline |
return the number of teleports due to vehicles stuck on the wrong lane
Definition at line 265 of file MSVehicleControl.h.
References getTeleportCount(), and myTeleportsWrongLane.
Referenced by MSNet::closeSimulation().
|
inline |
return the number of teleports due to vehicles stuck on a minor road
Definition at line 260 of file MSVehicleControl.h.
References myTeleportsYield.
Referenced by MSNet::closeSimulation().
|
inline |
Returns the total departure delay.
Definition at line 281 of file MSVehicleControl.h.
References myTotalDepartureDelay.
Referenced by MSNet::writeOutput().
|
inline |
Returns the total travel time.
Definition at line 289 of file MSVehicleControl.h.
References addVType(), addVTypeDistribution(), addWaiting(), DEFAULT_VTYPE_ID, getVType(), getWaitingVehicle(), hasVType(), hasVTypeDistribution(), insertVTypeIDs(), myTotalTravelTime, removeVType(), and removeWaiting().
Referenced by MSNet::writeOutput().
SUMOVehicle * MSVehicleControl::getVehicle | ( | const std::string & | id | ) | const |
Returns the vehicle with the given id.
If no vehicle with the given id is store din "myVehicleDict", 0 is returned.
[in] | id | The id of the vehicle to retrieve |
Definition at line 213 of file MSVehicleControl.cpp.
References myVehicleDict.
Referenced by libsumo::Vehicle::add(), MSStateHandler::closeVehicle(), MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), TraCIServerAPI_Vehicle::getPosition(), libsumo::Vehicle::getVehicle(), libsumo::Vehicle::isOnInit(), MSVehicleTransfer::loadState(), MESegment::loadState(), MSLane::loadState(), MSDevice_SSM::processEncounters(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), MSCalibrator::removePending(), and GUINet::vehicleExists().
MSVehicleType * MSVehicleControl::getVType | ( | const std::string & | id = DEFAULT_VTYPE_ID , |
std::mt19937 * | rng = 0 |
||
) |
Returns the named vehicle type or a sample from the named distribution.
[in] | id | The id of the vehicle type to return. If left out, the default type is returned. |
Definition at line 303 of file MSVehicleControl.cpp.
References DEFAULT_PEDTYPE_ID, DEFAULT_VTYPE_ID, myDefaultPedTypeMayBeDeleted, myDefaultVTypeMayBeDeleted, myVTypeDict, and myVTypeDistDict.
Referenced by libsumo::Person::add(), libsumo::Vehicle::add(), MSRouteHandler::addPersonTrip(), MSRouteHandler::closeContainer(), MSRouteHandler::closePerson(), MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), METriggeredCalibrator::execute(), MSCalibrator::execute(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), getTotalTravelTime(), libsumo::VehicleType::getVType(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSDevice_Bluelight::notifyMove(), MSRouteHandler::openVehicleTypeDistribution(), TraCIServerAPI_Vehicle::processSet(), METriggeredCalibrator::remainingVehicleCapacity(), MSCalibrator::remainingVehicleCapacity(), libsumo::Person::setType(), libsumo::Vehicle::setType(), and MSMeanData_Emissions::MSLaneMeanDataValues::write().
SUMOVehicle * MSVehicleControl::getWaitingVehicle | ( | const MSEdge *const | edge, |
const std::set< std::string > & | lines, | ||
const double | position, | ||
const std::string | ridingID | ||
) |
Definition at line 354 of file MSVehicleControl.cpp.
References DEPART_TRIGGERED, Named::getID(), SUMOVehicle::getParameter(), SUMOVehicleParameter::line, myWaiting, toString(), and WRITE_WARNING.
Referenced by getTotalTravelTime(), MSContainer::MSContainerStage_Driving::proceed(), and MSPerson::MSPersonStage_Driving::proceed().
bool MSVehicleControl::hasVType | ( | const std::string & | id | ) | const |
Asks for existence of a vehicle type.
If vehicle type or distribution with the id exists, true is returned, false otherwise.
[in] | id | The id of the type or distribution |
Definition at line 291 of file MSVehicleControl.cpp.
References myVTypeDict, and myVTypeDistDict.
Referenced by libsumo::Simulation::findIntermodalRoute(), and getTotalTravelTime().
bool MSVehicleControl::hasVTypeDistribution | ( | const std::string & | id | ) | const |
Asks for a vehicle type distribution.
If vehicle type distribution with the id exists, true is returned, false otherwise.
[in] | id | The id of the distribution |
Definition at line 297 of file MSVehicleControl.cpp.
References myVTypeDistDict.
Referenced by getTotalTravelTime().
void MSVehicleControl::insertVTypeIDs | ( | std::vector< std::string > & | into | ) | const |
Inserts ids of all known vehicle types and vehicle type distributions to the given vector.
[in] | into | The vector to fill with ids |
Definition at line 322 of file MSVehicleControl.cpp.
References myVTypeDict, and myVTypeDistDict.
Referenced by libsumo::VehicleType::getIDList(), and getTotalTravelTime().
|
inline |
Returns the begin of the internal vehicle map.
Definition at line 166 of file MSVehicleControl.h.
References myVehicleDict.
Referenced by GUIApplicationWindow::checkGamingEvents(), MSVTypeProbe::execute(), MSNet::getHaltingVehicleNumber(), libsumo::Vehicle::getIDList(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), MSNet::getVehicleMeanSpeeds(), MSDevice_Bluelight::notifyMove(), MSVehicleType::setActionStepLength(), MSEmissionExport::write(), MSBatteryExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), and MSFullExport::writeVehicles().
|
inline |
Returns the end of the internal vehicle map.
Definition at line 174 of file MSVehicleControl.h.
References myVehicleDict, and vehicleDeparted().
Referenced by GUIApplicationWindow::checkGamingEvents(), MSVTypeProbe::execute(), MSNet::getHaltingVehicleNumber(), libsumo::Vehicle::getIDList(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), MSNet::getVehicleMeanSpeeds(), MSDevice_Bluelight::notifyMove(), MSVehicleType::setActionStepLength(), MSEmissionExport::write(), MSBatteryExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), and MSFullExport::writeVehicles().
|
private |
invalidated assignment operator
|
inline |
registers one collision-related teleport
Definition at line 404 of file MSVehicleControl.h.
References myCollisions.
Referenced by MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), MSLane::executeMovements(), and MSLane::handleCollisionBetween().
|
inline |
register emergency stop
Definition at line 424 of file MSVehicleControl.h.
References myEmergencyStops, saveState(), and setState().
Referenced by MSVehicle::executeMove().
|
inline |
increases the count of vehicles waiting for a transport to allow recognition of person / container related deadlocks
Definition at line 385 of file MSVehicleControl.h.
References myWaitingForContainer, and myWaitingForPerson.
Referenced by addVehicle(), and MSVehicle::processNextStop().
|
inline |
register one non-collision-related teleport
Definition at line 409 of file MSVehicleControl.h.
References myTeleportsJam.
Referenced by MSLane::executeMovements(), and MELoop::teleportVehicle().
|
inline |
register one non-collision-related teleport
Definition at line 419 of file MSVehicleControl.h.
References myTeleportsWrongLane.
Referenced by MSLane::executeMovements().
|
inline |
register one non-collision-related teleport
Definition at line 414 of file MSVehicleControl.h.
References myTeleportsYield.
Referenced by MSLane::executeMovements().
void MSVehicleControl::removeVType | ( | const MSVehicleType * | vehType | ) |
Definition at line 272 of file MSVehicleControl.cpp.
References MSVehicleType::getID(), and myVTypeDict.
Referenced by getTotalTravelTime(), MSBaseVehicle::replaceVehicleType(), MSTransportable::replaceVehicleType(), MSTransportable::~MSTransportable(), and MSVehicle::~MSVehicle().
void MSVehicleControl::removeWaiting | ( | const MSEdge *const | edge, |
SUMOVehicle * | vehicle | ||
) |
Removes a vehicle from the list of waiting vehicles to a given edge.
Definition at line 343 of file MSVehicleControl.cpp.
References myWaiting.
Referenced by getTotalTravelTime(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), and MSVehicle::resumeFromStopping().
void MSVehicleControl::saveState | ( | OutputDevice & | out | ) |
Saves the current state into the given stream.
Definition at line 164 of file MSVehicleControl.cpp.
References OutputDevice::closeTag(), myEndedVehNo, myLoadedVehNo, myRunningVehNo, myTotalDepartureDelay, myTotalTravelTime, myVehicleDict, myVTypeDict, myVTypeDistDict, OutputDevice::openTag(), SUMO_ATTR_BEGIN, SUMO_ATTR_DEPART, SUMO_ATTR_END, SUMO_ATTR_ID, SUMO_ATTR_NUMBER, SUMO_ATTR_PROBS, SUMO_ATTR_TIME, SUMO_ATTR_VTYPES, SUMO_TAG_DELAY, SUMO_TAG_VTYPE_DISTRIBUTION, and OutputDevice::writeAttr().
Referenced by registerEmergencyStop(), and MSStateHandler::saveState().
void MSVehicleControl::scheduleVehicleRemoval | ( | SUMOVehicle * | veh | ) |
Removes a vehicle after it has ended.
Writes output to tripinfos and vehroutes if wished; decrements the number of running vehicles and increments the number of ended vehicles. Then deletes the vehicle using "deleteVehicle".
This method should be called for each vehicle that was inserted into the network and quits its ride.
[in] | veh | The vehicle to remove |
Definition at line 124 of file MSVehicleControl.cpp.
References OutputDevice::closeTag(), deleteVehicle(), SUMOVehicle::getDeparture(), OutputDevice::getDeviceByOption(), SUMOVehicle::getDevices(), MSNet::getInstance(), OptionsCont::getOptions(), MSNet::informVehicleStateListener(), myRunningVehNo, myTotalTravelTime, STEPS2TIME, and MSNet::VEHICLE_STATE_ARRIVED.
Referenced by MSVehicleTransfer::add(), MELoop::changeSegment(), MSVehicleTransfer::checkInsertions(), MSLane::detectCollisions(), MSLane::executeMovements(), libsumo::Vehicle::moveTo(), TraCIServerAPI_Vehicle::processSet(), MESegment::receive(), and MSCalibrator::removePending().
void MSVehicleControl::setState | ( | int | runningVehNo, |
int | loadedVehNo, | ||
int | endedVehNo, | ||
double | totalDepartureDelay, | ||
double | totalTravelTime | ||
) |
Sets the current state variables as loaded from the stream.
Definition at line 154 of file MSVehicleControl.cpp.
References myEndedVehNo, myLoadedVehNo, myRunningVehNo, myTotalDepartureDelay, and myTotalTravelTime.
Referenced by MSStateHandler::myStartElement(), and registerEmergencyStop().
|
inline |
decreases the count of vehicles waiting for a transport to allow recognition of person / container related deadlocks
Definition at line 395 of file MSVehicleControl.h.
References myWaitingForContainer, and myWaitingForPerson.
Referenced by MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSVehicle::processNextStop(), and MSVehicle::resumeFromStopping().
void MSVehicleControl::vehicleDeparted | ( | const SUMOVehicle & | v | ) |
Informs this control about a vehicle's departure.
If the mean waiting time shall be computed (f.e. for summary-output), the absolut waiting time is increased by the waiting time of the given vehicle.
[in] | v | The inserted vehicle |
Definition at line 141 of file MSVehicleControl.cpp.
References SUMOVehicleParameter::depart, MSVehicleType::getCarFollowModel(), SUMOVehicle::getChosenSpeedFactor(), SUMOVehicle::getDeparture(), MSNet::getInstance(), MSCFModel::getMaxDecel(), SUMOVehicle::getParameter(), SUMOVehicle::getVClass(), SUMOVehicle::getVehicleType(), MSNet::informVehicleStateListener(), MAX2(), MIN2(), myMaxSpeedFactor, myMinDeceleration, myRunningVehNo, myTotalDepartureDelay, STEPFLOOR, STEPS2TIME, SVC_PEDESTRIAN, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_SHIP, and MSNet::VEHICLE_STATE_DEPARTED.
Referenced by loadedVehEnd(), and MSBaseVehicle::onDepart().
|
private |
The number of collisions.
Definition at line 498 of file MSVehicleControl.h.
Referenced by getCollisionCount(), getTeleportCount(), and registerCollision().
|
private |
Whether no pedestrian type was loaded.
Definition at line 555 of file MSVehicleControl.h.
Referenced by checkVType(), and getVType().
|
private |
Whether no vehicle type was loaded.
Definition at line 552 of file MSVehicleControl.h.
Referenced by checkVType(), and getVType().
|
private |
The number of vehicles which were discarded while loading.
Definition at line 495 of file MSVehicleControl.h.
Referenced by deleteVehicle(), discountStateLoaded(), and getDepartedVehicleNo().
|
private |
The number of emergency stops.
Definition at line 510 of file MSVehicleControl.h.
Referenced by getEmergencyStops(), and registerEmergencyStop().
|
private |
The number of removed vehicles.
Definition at line 492 of file MSVehicleControl.h.
Referenced by deleteVehicle(), discountStateLoaded(), getActiveVehicleCount(), getDepartedVehicleNo(), getEndedVehicleNo(), saveState(), and setState().
|
protected |
The number of build vehicles.
Definition at line 485 of file MSVehicleControl.h.
Referenced by MEVehicleControl::buildVehicle(), GUIMEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), buildVehicle(), discountStateLoaded(), getActiveVehicleCount(), getLoadedVehicleNo(), getQuota(), saveState(), and setState().
|
private |
The maximum random offset to be added to vehicles departure times (non-negative)
Definition at line 570 of file MSVehicleControl.h.
Referenced by computeRandomDepartOffset(), and MSVehicleControl().
|
private |
The maximum speed factor for all vehicles in the network.
Definition at line 573 of file MSVehicleControl.h.
Referenced by getMaxSpeedFactor(), and vehicleDeparted().
|
private |
The minimum deceleration capability for all vehicles in the network.
Definition at line 576 of file MSVehicleControl.h.
Referenced by getMinDeceleration(), and vehicleDeparted().
|
private |
List of vehicles which belong to public transport.
Definition at line 579 of file MSVehicleControl.h.
Referenced by adaptIntermodalRouter(), and addVehicle().
|
private |
The number of vehicles within the network (build and inserted but not removed)
Definition at line 489 of file MSVehicleControl.h.
Referenced by discountStateLoaded(), getDepartedVehicleNo(), getRunningVehicleNo(), saveState(), scheduleVehicleRemoval(), setState(), and vehicleDeparted().
|
private |
The scaling factor (especially for inc-dua)
Definition at line 567 of file MSVehicleControl.h.
Referenced by getQuota(), and MSVehicleControl().
|
private |
The number of teleports due to jam.
Definition at line 501 of file MSVehicleControl.h.
Referenced by getTeleportCount(), getTeleportsJam(), and registerTeleportJam().
|
private |
The number of teleports due to vehicles stuck on the wrong lane.
Definition at line 507 of file MSVehicleControl.h.
Referenced by getTeleportCount(), getTeleportsWrongLane(), and registerTeleportWrongLane().
|
private |
The number of teleports due to vehicles stuck on a minor road.
Definition at line 504 of file MSVehicleControl.h.
Referenced by getTeleportCount(), getTeleportsYield(), and registerTeleportYield().
|
private |
The aggregated time vehicles had to wait for departure (in seconds)
Definition at line 519 of file MSVehicleControl.h.
Referenced by getTotalDepartureDelay(), saveState(), setState(), and vehicleDeparted().
|
private |
The aggregated time vehicles needed to aacomplish their route (in seconds)
Definition at line 522 of file MSVehicleControl.h.
Referenced by getTotalTravelTime(), saveState(), scheduleVehicleRemoval(), and setState().
|
protected |
Dictionary of vehicles.
Definition at line 533 of file MSVehicleControl.h.
Referenced by abortWaiting(), addVehicle(), deleteVehicle(), getVehicle(), GUIMEVehicleControl::insertVehicleIDs(), GUIVehicleControl::insertVehicleIDs(), loadedVehBegin(), loadedVehEnd(), saveState(), and ~MSVehicleControl().
|
private |
Dictionary of vehicle types.
Definition at line 544 of file MSVehicleControl.h.
Referenced by addVType(), checkVType(), getVType(), hasVType(), insertVTypeIDs(), MSVehicleControl(), removeVType(), saveState(), and ~MSVehicleControl().
|
private |
A distribution of vehicle types (probability->vehicle type)
Definition at line 549 of file MSVehicleControl.h.
Referenced by addVTypeDistribution(), checkVType(), getVType(), hasVType(), hasVTypeDistribution(), insertVTypeIDs(), saveState(), and ~MSVehicleControl().
|
private |
the lists of waiting vehicles to a given edge
Definition at line 558 of file MSVehicleControl.h.
Referenced by addWaiting(), getWaitingVehicle(), and removeWaiting().
|
private |
the number of vehicles wainting for containers contained in myWaiting which can only continue by being triggered
Definition at line 564 of file MSVehicleControl.h.
Referenced by getActiveVehicleCount(), registerOneWaiting(), and unregisterOneWaiting().
|
private |
the number of vehicles wainting for persons contained in myWaiting which can only continue by being triggered
Definition at line 561 of file MSVehicleControl.h.
Referenced by getActiveVehicleCount(), registerOneWaiting(), and unregisterOneWaiting().