SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MEVehicleControl Class Reference

The class responsible for building and deletion of vehicles (gui-version) More...

#include <MEVehicleControl.h>

Inheritance diagram for MEVehicleControl:
Inheritance graph
Collaboration diagram for MEVehicleControl:
Collaboration graph

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 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 ()
 avoid counting a vehicle twice if it was loaded from state and route input More...
 
SUMOReal getMaxSpeedFactor () const
 return the maximum speed factor for all vehicles that ever entered the network More...
 
SUMOReal getMinDeceleration () const
 return the minimum deceleration capability for all vehicles that ever entered the network More...
 
SUMOVehiclegetWaitingVehicle (const MSEdge *const edge, const std::set< std::string > &lines, const SUMOReal position, const std::string ridingID)
 
 MEVehicleControl ()
 Constructor. More...
 
void registerCollision ()
 registers one collision-related teleport More...
 
void registerEmergencyStop ()
 register emergency stop More...
 
void registerOneWaitingForContainer ()
 increases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks More...
 
void registerOneWaitingForPerson ()
 increases the count of vehicles waiting for a person to allow recogniztion of person 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 unregisterOneWaitingForContainer ()
 decreases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks More...
 
void unregisterOneWaitingForPerson ()
 decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlocks More...
 
 ~MEVehicleControl ()
 Destructor. More...
 
Vehicle creation
virtual SUMOVehiclebuildVehicle (SUMOVehicleParameter *defs, const MSRoute *route, const 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...
 
SUMOVehiclegetVehicle (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 (SUMOReal 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...
 
SUMOReal getTotalDepartureDelay () const
 Returns the total departure delay. More...
 
SUMOReal getTotalTravelTime () const
 Returns the total travel time. More...
 
Insertion and retrieval of vehicle types
bool addVType (MSVehicleType *vehType)
 Adds a vehicle type. More...
 
bool addVTypeDistribution (const std::string &id, RandomDistributor< MSVehicleType * > *vehTypeDistribution)
 Adds a vehicle type distribution. More...
 
bool hasVTypeDistribution (const std::string &id) const
 Asks for a vehicle type distribution. More...
 
MSVehicleTypegetVType (const std::string &id=DEFAULT_VTYPE_ID, MTRand *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, SUMOReal totalDepartureDelay, SUMOReal 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...
 

Protected Attributes

Vehicle statistics (always accessable)
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 statistics
SUMOReal myTotalDepartureDelay
 The aggregated time vehicles had to wait for departure (in seconds) More...
 
SUMOReal myTotalTravelTime
 The aggregated time vehicles needed to aacomplish their route (in seconds) More...
 

Private Member Functions

 MEVehicleControl (const MEVehicleControl &s)
 invalidated copy constructor More...
 
MEVehicleControloperator= (const MEVehicleControl &s)
 invalidated assignment operator 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...
 
SUMOReal 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...
 
SUMOReal myMaxSpeedFactor
 The maximum speed factor for all vehicles in the network. More...
 
SUMOReal myMinDeceleration
 The minimum deceleration capability for all vehicles in the network. More...
 

Detailed Description

The class responsible for building and deletion of vehicles (gui-version)

Builds GUIVehicle instances instead of MSVehicle.

See also
MSVehicleControl
Todo:

This is partially unsecure due to concurrent access...

Recheck vehicle deletion

Definition at line 50 of file MEVehicleControl.h.

Member Typedef Documentation

typedef std::map<std::string, SUMOVehicle*>::const_iterator MSVehicleControl::constVehIt
inherited

Definition of the internal vehicles map iterator.

Definition at line 77 of file MSVehicleControl.h.

typedef std::map< std::string, SUMOVehicle* > MSVehicleControl::VehicleDictType
protectedinherited

Vehicle dictionary type.

Definition at line 508 of file MSVehicleControl.h.

typedef std::map< std::string, MSVehicleType* > MSVehicleControl::VTypeDictType
protectedinherited

Vehicle type dictionary type.

Definition at line 518 of file MSVehicleControl.h.

typedef std::map< std::string, RandomDistributor<MSVehicleType*>* > MSVehicleControl::VTypeDistDictType
protectedinherited

Vehicle type distribution dictionary type.

Definition at line 523 of file MSVehicleControl.h.

Constructor & Destructor Documentation

MEVehicleControl::MEVehicleControl ( )

Constructor.

Definition at line 51 of file MEVehicleControl.cpp.

MEVehicleControl::~MEVehicleControl ( )

Destructor.

Definition at line 55 of file MEVehicleControl.cpp.

MEVehicleControl::MEVehicleControl ( const MEVehicleControl s)
private

invalidated copy constructor

Member Function Documentation

void MSVehicleControl::abortWaiting ( )
inherited

informes about all waiting vehicles (deletion in destructor)

Definition at line 361 of file MSVehicleControl.cpp.

References MSVehicleControl::myVehicleDict, and WRITE_WARNING.

Referenced by MSNet::simulationState().

bool MSVehicleControl::addVehicle ( const std::string &  id,
SUMOVehicle v 
)
virtualinherited

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" and true is returned.

The vehicle control gets responsible for vehicle deletion.

Parameters
[in]idThe id of the vehicle
[in]vThe vehicle
Returns
Whether the vehicle could be inserted (no other vehicle with the same id was inserted before)

Reimplemented in GUIVehicleControl, and GUIMEVehicleControl.

Definition at line 190 of file MSVehicleControl.cpp.

References MSVehicleControl::myVehicleDict.

Referenced by GUIMEVehicleControl::addVehicle(), GUIVehicleControl::addVehicle(), MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), MSCalibrator::execute(), MSStateHandler::myStartElement(), TraCIServerAPI_Vehicle::processSet(), and METriggeredCalibrator::tryEmit().

bool MSVehicleControl::addVType ( MSVehicleType vehType)
inherited

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.

Parameters
[in]vehTypeThe vehicle type to add
Returns
Whether the vehicle type could be added

Definition at line 251 of file MSVehicleControl.cpp.

References MSVehicleControl::checkVType(), MSVehicleType::getID(), and MSVehicleControl::myVTypeDict.

Referenced by MSStateHandler::myEndElement().

bool MSVehicleControl::addVTypeDistribution ( const std::string &  id,
RandomDistributor< MSVehicleType * > *  vehTypeDistribution 
)
inherited

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.

Parameters
[in]idThe id of the distribution to add
[in]vehTypeDistributionThe vehicle type distribution to add
Returns
Whether the vehicle type could be added

Definition at line 261 of file MSVehicleControl.cpp.

References MSVehicleControl::checkVType(), and MSVehicleControl::myVTypeDistDict.

Referenced by MSStateHandler::myStartElement().

void MSVehicleControl::addWaiting ( const MSEdge *const  edge,
SUMOVehicle vehicle 
)
inherited

Adds a vehicle to the list of waiting vehiclse to a given edge.

Definition at line 308 of file MSVehicleControl.cpp.

References MSVehicleControl::myWaiting.

Referenced by MSRouteHandler::closeVehicle(), and MSVehicle::processNextStop().

SUMOVehicle * MEVehicleControl::buildVehicle ( SUMOVehicleParameter defs,
const MSRoute route,
const MSVehicleType type,
const bool  ignoreStopErrors,
const bool  fromRouteFile = true 
)
virtual

Builds a vehicle, increases the number of built vehicles.

Instead of a MSVehicle, a GUIVehicle is built

Parameters
[in]defsThe parameter defining the vehicle
[in]routeThe route of this vehicle
[in]typeThe type of this vehicle
[in]ignoreStopErrorswhether invalid stops trigger a warning only
[in]fromRouteFilewhether we are just reading the route file or creating via trigger, traci, ...
Returns
The built vehicle (MEVehicle instance)
See also
MSVehicleControl::buildVehicle

Reimplemented from MSVehicleControl.

Reimplemented in GUIMEVehicleControl.

Definition at line 59 of file MEVehicleControl.cpp.

References MSBaseVehicle::addStops(), MSVehicleType::computeChosenSpeedDeviation(), MSVehicleControl::computeRandomDepartOffset(), SUMOVehicleParameter::depart, MSNet::getInstance(), MSRouteHandler::getParsingRNG(), MSNet::informVehicleStateListener(), MSVehicleControl::myLoadedVehNo, and MSNet::VEHICLE_STATE_BUILT.

SUMOTime MSVehicleControl::computeRandomDepartOffset ( ) const
inherited
void MSVehicleControl::deleteVehicle ( SUMOVehicle v,
bool  discard = false 
)
virtualinherited
void MSVehicleControl::discountStateLoaded ( )
inlineinherited

avoid counting a vehicle twice if it was loaded from state and route input

Definition at line 428 of file MSVehicleControl.h.

References MSVehicleControl::myLoadedVehNo.

Referenced by MSInsertionControl::determineCandidates(), and MSStateHandler::myStartElement().

int MSVehicleControl::getActiveVehicleCount ( ) const
inlineinherited

Returns the number of build vehicles that have not been removed or need to wait for a passenger or a container.

Returns
Number of active vehicles

Definition at line 243 of file MSVehicleControl.h.

References MSVehicleControl::myEndedVehNo, MSVehicleControl::myLoadedVehNo, MSVehicleControl::myWaitingForContainer, and MSVehicleControl::myWaitingForPerson.

Referenced by MSNet::simulationState().

int MSVehicleControl::getCollisionCount ( ) const
inlineinherited

return the number of collisions

Definition at line 249 of file MSVehicleControl.h.

References MSVehicleControl::myCollisions.

Referenced by GUIApplicationWindow::checkGamingEvents(), MSNet::closeSimulation(), and GUINet::getParameterWindow().

int MSVehicleControl::getDepartedVehicleNo ( ) const
inlineinherited

Returns the number of inserted vehicles.

Returns
The number of vehicles that have entered the simulation so far

Definition at line 225 of file MSVehicleControl.h.

References MSVehicleControl::myDiscarded, MSVehicleControl::myEndedVehNo, and MSVehicleControl::myRunningVehNo.

Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), MSNet::postSimStepOutput(), and MSNet::writeOutput().

int MSVehicleControl::getEmergencyStops ( ) const
inlineinherited

return the number of emergency stops

Definition at line 272 of file MSVehicleControl.h.

References MSVehicleControl::myEmergencyStops.

Referenced by MSNet::closeSimulation().

int MSVehicleControl::getEndedVehicleNo ( ) const
inlineinherited

Returns the number of removed vehicles.

Returns
The number of vehicles that have left the simulation

Definition at line 209 of file MSVehicleControl.h.

References MSVehicleControl::myEndedVehNo.

Referenced by GUINet::getParameterWindow(), and MSNet::writeOutput().

int MSVehicleControl::getLoadedVehicleNo ( ) const
inlineinherited

Returns the number of build vehicles.

Returns
The number of loaded (build) vehicles

Definition at line 201 of file MSVehicleControl.h.

References MSVehicleControl::myLoadedVehNo.

Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), and MSNet::writeOutput().

SUMOReal MSVehicleControl::getMaxSpeedFactor ( ) const
inlineinherited

return the maximum speed factor for all vehicles that ever entered the network

Definition at line 441 of file MSVehicleControl.h.

References MSVehicleControl::myMaxSpeedFactor.

Referenced by MSLane::getMaximumBrakeDist().

SUMOReal MSVehicleControl::getMinDeceleration ( ) const
inlineinherited

return the minimum deceleration capability for all vehicles that ever entered the network

Definition at line 446 of file MSVehicleControl.h.

References MSVehicleControl::myMinDeceleration.

Referenced by MSLane::getMaximumBrakeDist().

int MSVehicleControl::getQuota ( SUMOReal  frac = -1) const
inherited

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)

Returns
the number of vehicles to create (something between 0 and ceil(frac))

Definition at line 369 of file MSVehicleControl.cpp.

References MSVehicleControl::myLoadedVehNo, and MSVehicleControl::myScale.

Referenced by MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), and MSDevice::equippedByDefaultAssignmentOptions().

int MSVehicleControl::getRunningVehicleNo ( ) const
inlineinherited

Returns the number of build and inserted, but not yet deleted vehicles.

Returns
The number simulated vehicles (including those in teleporter)

Definition at line 217 of file MSVehicleControl.h.

References MSVehicleControl::myRunningVehNo.

Referenced by MSNet::closeSimulation(), GUINet::getParameterWindow(), GUIApplicationWindow::handleEvent_SimulationStep(), MSNet::postSimStepOutput(), GUINet::setSimDuration(), MSNet::simulationStep(), and MSNet::writeOutput().

int MSVehicleControl::getTeleportCount ( ) const
inherited
int MSVehicleControl::getTeleportsJam ( ) const
inlineinherited

return the number of teleports due to jamming

Definition at line 254 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsJam.

Referenced by MSNet::closeSimulation().

int MSVehicleControl::getTeleportsWrongLane ( ) const
inlineinherited

return the number of teleports due to vehicles stuck on the wrong lane

Definition at line 264 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsWrongLane.

Referenced by MSNet::closeSimulation().

int MSVehicleControl::getTeleportsYield ( ) const
inlineinherited

return the number of teleports due to vehicles stuck on a minor road

Definition at line 259 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsYield.

Referenced by MSNet::closeSimulation().

SUMOReal MSVehicleControl::getTotalDepartureDelay ( ) const
inlineinherited

Returns the total departure delay.

Returns
Sum of steps vehicles had to wait until being inserted

Definition at line 280 of file MSVehicleControl.h.

References MSVehicleControl::myTotalDepartureDelay.

Referenced by MSNet::writeOutput().

SUMOReal MSVehicleControl::getTotalTravelTime ( ) const
inlineinherited

Returns the total travel time.

Returns
Sum of travel times of arrived vehicles

Definition at line 288 of file MSVehicleControl.h.

References MSVehicleControl::myTotalTravelTime.

Referenced by MSNet::writeOutput().

SUMOVehicle * MSVehicleControl::getVehicle ( const std::string &  id) const
inherited

Returns the vehicle with the given id.

If no vehicle with the given id is store din "myVehicleDict", 0 is returned.

Parameters
[in]idThe id of the vehicle to retrieve
Returns
The vehicle with the given id, 0 if no such vehicle exists

Definition at line 202 of file MSVehicleControl.cpp.

References MSVehicleControl::myVehicleDict.

Referenced by MSRouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), TraCIServerAPI_Vehicle::getPosition(), MESegment::loadState(), MSLane::loadState(), MSStateHandler::myStartElement(), TraCIServer::postProcessVTD(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Vehicle::processSet(), MSCalibrator::removePending(), and GUINet::vehicleExists().

SUMOVehicle * MSVehicleControl::getWaitingVehicle ( const MSEdge *const  edge,
const std::set< std::string > &  lines,
const SUMOReal  position,
const std::string  ridingID 
)
inherited
bool MSVehicleControl::hasVTypeDistribution ( const std::string &  id) const
inherited

Asks for a vehicle type distribution.

If vehicle type distribution with the id exists, true is returned, false otherwise.

Parameters
[in]idThe id of the distribution
Returns
Whether the vehicle type distribution exists

Definition at line 271 of file MSVehicleControl.cpp.

References MSVehicleControl::myVTypeDistDict.

void MSVehicleControl::insertVTypeIDs ( std::vector< std::string > &  into) const
inherited

Inserts ids of all known vehicle types and vehicle type distributions to the given vector.

Parameters
[in]intoThe vector to fill with ids

Definition at line 296 of file MSVehicleControl.cpp.

References MSVehicleControl::myVTypeDict, and MSVehicleControl::myVTypeDistDict.

Referenced by TraCIServerAPI_VehicleType::processGet().

constVehIt MSVehicleControl::loadedVehBegin ( ) const
inlineinherited
constVehIt MSVehicleControl::loadedVehEnd ( ) const
inlineinherited
MEVehicleControl& MEVehicleControl::operator= ( const MEVehicleControl s)
private

invalidated assignment operator

void MSVehicleControl::registerCollision ( )
inlineinherited

registers one collision-related teleport

Definition at line 391 of file MSVehicleControl.h.

References MSVehicleControl::myCollisions.

Referenced by MSLane::executeMovements(), and MSLane::handleCollisionBetween().

void MSVehicleControl::registerEmergencyStop ( )
inlineinherited

register emergency stop

Definition at line 411 of file MSVehicleControl.h.

References MSVehicleControl::myEmergencyStops.

Referenced by MSVehicle::executeMove().

void MSVehicleControl::registerOneWaitingForContainer ( )
inlineinherited

increases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks

Definition at line 380 of file MSVehicleControl.h.

References MSVehicleControl::myWaitingForContainer.

Referenced by MSRouteHandler::closeVehicle(), and MSVehicle::processNextStop().

void MSVehicleControl::registerOneWaitingForPerson ( )
inlineinherited

increases the count of vehicles waiting for a person to allow recogniztion of person related deadlocks

Definition at line 368 of file MSVehicleControl.h.

References MSVehicleControl::myWaitingForPerson.

Referenced by MSRouteHandler::closeVehicle(), and MSVehicle::processNextStop().

void MSVehicleControl::registerTeleportJam ( )
inlineinherited

register one non-collision-related teleport

Definition at line 396 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsJam.

Referenced by MSLane::executeMovements(), and MELoop::teleportVehicle().

void MSVehicleControl::registerTeleportWrongLane ( )
inlineinherited

register one non-collision-related teleport

Definition at line 406 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsWrongLane.

Referenced by MSLane::executeMovements().

void MSVehicleControl::registerTeleportYield ( )
inlineinherited

register one non-collision-related teleport

Definition at line 401 of file MSVehicleControl.h.

References MSVehicleControl::myTeleportsYield.

Referenced by MSLane::executeMovements().

void MSVehicleControl::removeWaiting ( const MSEdge *const  edge,
SUMOVehicle vehicle 
)
inherited

Removes a vehicle from the list of waiting vehicles to a given edge.

Definition at line 317 of file MSVehicleControl.cpp.

References MSVehicleControl::myWaiting.

Referenced by MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), and MSVehicle::resumeFromStopping().

void MSVehicleControl::scheduleVehicleRemoval ( SUMOVehicle veh)
inherited

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.

Parameters
[in]vehThe vehicle to remove

Definition at line 129 of file MSVehicleControl.cpp.

References OutputDevice::closeTag(), MSVehicleControl::deleteVehicle(), SUMOVehicle::getDeparture(), OutputDevice::getDeviceByOption(), SUMOVehicle::getDevices(), MSNet::getInstance(), OptionsCont::getOptions(), MSNet::informVehicleStateListener(), MSVehicleControl::myRunningVehNo, MSVehicleControl::myTotalTravelTime, STEPS2TIME, and MSNet::VEHICLE_STATE_ARRIVED.

Referenced by MSVehicleTransfer::add(), MELoop::changeSegment(), MSVehicleTransfer::checkInsertions(), MSLane::detectCollisions(), MSLane::executeMovements(), TraCIServerAPI_Vehicle::processSet(), MESegment::receive(), and MSCalibrator::removePending().

void MSVehicleControl::setState ( int  runningVehNo,
int  loadedVehNo,
int  endedVehNo,
SUMOReal  totalDepartureDelay,
SUMOReal  totalTravelTime 
)
inherited
void MSVehicleControl::unregisterOneWaitingForContainer ( )
inlineinherited

decreases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks

Definition at line 386 of file MSVehicleControl.h.

References MSVehicleControl::myWaitingForContainer.

Referenced by MSContainer::MSContainerStage_Driving::proceed(), MSVehicle::processNextStop(), and MSVehicle::resumeFromStopping().

void MSVehicleControl::unregisterOneWaitingForPerson ( )
inlineinherited

decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlocks

Definition at line 374 of file MSVehicleControl.h.

References MSVehicleControl::myWaitingForPerson.

Referenced by MSPerson::MSPersonStage_Driving::proceed(), MSVehicle::processNextStop(), and MSVehicle::resumeFromStopping().

void MSVehicleControl::vehicleDeparted ( const SUMOVehicle v)
inherited

Field Documentation

int MSVehicleControl::myCollisions
protectedinherited
bool MSVehicleControl::myDefaultPedTypeMayBeDeleted
protectedinherited

Whether no pedestrian type was loaded.

Definition at line 531 of file MSVehicleControl.h.

Referenced by MSVehicleControl::checkVType(), and MSVehicleControl::getVType().

bool MSVehicleControl::myDefaultVTypeMayBeDeleted
protectedinherited

Whether no vehicle type was loaded.

Definition at line 528 of file MSVehicleControl.h.

Referenced by MSVehicleControl::checkVType(), and MSVehicleControl::getVType().

int MSVehicleControl::myDiscarded
protectedinherited

The number of vehicles which were discarded while loading.

Definition at line 473 of file MSVehicleControl.h.

Referenced by MSVehicleControl::deleteVehicle(), and MSVehicleControl::getDepartedVehicleNo().

int MSVehicleControl::myEmergencyStops
protectedinherited

The number of emergency stops.

Definition at line 488 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getEmergencyStops(), and MSVehicleControl::registerEmergencyStop().

SUMOTime MSVehicleControl::myMaxRandomDepartOffset
protectedinherited

The maximum random offset to be added to vehicles departure times (non-negative)

Definition at line 546 of file MSVehicleControl.h.

Referenced by MSVehicleControl::computeRandomDepartOffset(), and MSVehicleControl::MSVehicleControl().

SUMOReal MSVehicleControl::myMaxSpeedFactor
protectedinherited

The maximum speed factor for all vehicles in the network.

Definition at line 549 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getMaxSpeedFactor(), and MSVehicleControl::vehicleDeparted().

SUMOReal MSVehicleControl::myMinDeceleration
protectedinherited

The minimum deceleration capability for all vehicles in the network.

Definition at line 552 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getMinDeceleration(), and MSVehicleControl::vehicleDeparted().

int MSVehicleControl::myRunningVehNo
protectedinherited
SUMOReal MSVehicleControl::myScale
protectedinherited

The scaling factor (especially for inc-dua)

Definition at line 543 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getQuota(), and MSVehicleControl::MSVehicleControl().

int MSVehicleControl::myTeleportsJam
protectedinherited

The number of teleports due to jam.

Definition at line 479 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getTeleportCount(), MSVehicleControl::getTeleportsJam(), and MSVehicleControl::registerTeleportJam().

int MSVehicleControl::myTeleportsWrongLane
protectedinherited

The number of teleports due to vehicles stuck on the wrong lane.

Definition at line 485 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getTeleportCount(), MSVehicleControl::getTeleportsWrongLane(), and MSVehicleControl::registerTeleportWrongLane().

int MSVehicleControl::myTeleportsYield
protectedinherited

The number of teleports due to vehicles stuck on a minor road.

Definition at line 482 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getTeleportCount(), MSVehicleControl::getTeleportsYield(), and MSVehicleControl::registerTeleportYield().

SUMOReal MSVehicleControl::myTotalDepartureDelay
protectedinherited

The aggregated time vehicles had to wait for departure (in seconds)

Definition at line 497 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getTotalDepartureDelay(), MSVehicleControl::saveState(), MSVehicleControl::setState(), and MSVehicleControl::vehicleDeparted().

SUMOReal MSVehicleControl::myTotalTravelTime
protectedinherited

The aggregated time vehicles needed to aacomplish their route (in seconds)

Definition at line 500 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getTotalTravelTime(), MSVehicleControl::saveState(), MSVehicleControl::scheduleVehicleRemoval(), and MSVehicleControl::setState().

std::map<const MSEdge* const, std::vector<SUMOVehicle*> > MSVehicleControl::myWaiting
protectedinherited

the lists of waiting vehicles to a given edge

Definition at line 534 of file MSVehicleControl.h.

Referenced by MSVehicleControl::addWaiting(), MSVehicleControl::getWaitingVehicle(), and MSVehicleControl::removeWaiting().

int MSVehicleControl::myWaitingForContainer
protectedinherited

the number of vehicles wainting for containers contained in myWaiting which can only continue by being triggered

Definition at line 540 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getActiveVehicleCount(), MSVehicleControl::registerOneWaitingForContainer(), and MSVehicleControl::unregisterOneWaitingForContainer().

int MSVehicleControl::myWaitingForPerson
protectedinherited

the number of vehicles wainting for persons contained in myWaiting which can only continue by being triggered

Definition at line 537 of file MSVehicleControl.h.

Referenced by MSVehicleControl::getActiveVehicleCount(), MSVehicleControl::registerOneWaitingForPerson(), and MSVehicleControl::unregisterOneWaitingForPerson().


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