Eclipse SUMO - Simulation of Urban MObility
MSVehicleTransfer Class Reference

#include <MSVehicleTransfer.h>

Collaboration diagram for MSVehicleTransfer:

Data Structures

struct  VehicleInformation
 Holds the information needed to move the vehicle over the network. More...
 

Public Member Functions

void add (const SUMOTime t, MSVehicle *veh)
 Adds a vehicle to this transfer object. More...
 
void checkInsertions (SUMOTime time)
 Checks "movement" of stored vehicles. More...
 
void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset, MSVehicleControl &vc)
 Loads one transfer vehicle state from the given descriptionn. More...
 
void remove (MSVehicle *veh)
 Remove a vehicle from this transfer object. More...
 
void saveState (OutputDevice &out)
 Saves the current state into the given stream. More...
 
virtual ~MSVehicleTransfer ()
 Destructor. More...
 

Static Public Member Functions

static MSVehicleTransfergetInstance ()
 Returns the instance of this object. More...
 

Static Public Attributes

static const double TeleportMinSpeed = 1
 The minimum speed while teleporting. More...
 

Protected Attributes

FXSynchQue< VehicleInformation, std::vector< VehicleInformation > > myVehicles
 The information about stored vehicles to move virtually. More...
 

Static Protected Attributes

static MSVehicleTransfermyInstance = nullptr
 The static singleton-instance. More...
 

Private Member Functions

 MSVehicleTransfer ()
 Constructor. More...
 

Detailed Description

This object (each simulation owns exactly one) is responsible for the transfer of vehicles that got stuck within the network due to grid locks. It also manages vehicles that are removed from the network because of stops with the parking attribute.

The method add is called by a lane if a vehicle stood to long at this lane's end. After being added to this transfer object and removed from the lane, it is moved over the consecutive edges. On each edge, it is tried to insert the vehicle again. The lanes are of course chosen by examining the vehicle's real route.

This object is used as a singleton

Definition at line 64 of file MSVehicleTransfer.h.

Constructor & Destructor Documentation

◆ ~MSVehicleTransfer()

MSVehicleTransfer::~MSVehicleTransfer ( )
virtual

Destructor.

Definition at line 193 of file MSVehicleTransfer.cpp.

References myInstance.

◆ MSVehicleTransfer()

MSVehicleTransfer::MSVehicleTransfer ( )
private

Constructor.

Definition at line 190 of file MSVehicleTransfer.cpp.

Referenced by getInstance().

Member Function Documentation

◆ add()

◆ checkInsertions()

void MSVehicleTransfer::checkInsertions ( SUMOTime  time)

Checks "movement" of stored vehicles.

Checks whether one of the stored vehicles may be inserted back into the network. If not, the vehicle may move virtually to the next lane of it's route

Parameters
[in]timeThe current simulation time

Definition at line 95 of file MSVehicleTransfer.cpp.

References MSEdge::allowedLanes(), MSVehicle::enterLaneAtMove(), MSLane::freeInsertion(), MSVehicle::getCurrentParkingArea(), MSEdge::getCurrentTravelTime(), MSBaseVehicle::getEdge(), MSEdge::getFreeLane(), Named::getID(), MSBaseVehicle::getID(), MSParkingArea::getInsertionPosition(), MSNet::getInstance(), MSVehicle::getLane(), MSEdge::getLanes(), MSVehicle::getLateralPositionOnLane(), MSBaseVehicle::getMaxSpeed(), MSVehicle::getPositionOnLane(), MSLane::getSpeedLimit(), MSVehicleType::getVehicleClass(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), MSNet::informVehicleStateListener(), MSLane::isInsertionSuccess(), MSVehicle::keepStopping(), MSVehicle::leaveLane(), MIN2(), MSVehicleTransfer::VehicleInformation::myParking, MSVehicleTransfer::VehicleInformation::myProceedTime, MSVehicleTransfer::VehicleInformation::myTransferTime, MSVehicleTransfer::VehicleInformation::myVeh, myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSParkingArea::notifyEgressBlocked(), MSVehicle::processNextStop(), MSLane::removeParking(), MSVehicleControl::scheduleVehicleRemoval(), MSVehicle::signalSet(), MSBaseVehicle::succEdge(), MSVehicle::switchOnSignal(), TeleportMinSpeed, TIME2STEPS, time2string(), MSVehicle::VEH_SIGNAL_BLINKER_LEFT, MSVehicle::VEH_SIGNAL_BLINKER_RIGHT, MSNet::VEHICLE_STATE_ENDING_PARKING, MSNet::VEHICLE_STATE_ENDING_TELEPORT, and WRITE_WARNING.

Referenced by MSNet::simulationStep().

◆ getInstance()

MSVehicleTransfer * MSVehicleTransfer::getInstance ( void  )
static

◆ loadState()

◆ remove()

void MSVehicleTransfer::remove ( MSVehicle veh)

Remove a vehicle from this transfer object.

The vehicle is removed from the transfer if present. This should be necessary only in the context of TraCI removals.

Parameters
[in]vehThe vehicle to remove

Definition at line 79 of file MSVehicleTransfer.cpp.

References MSVehicle::getLane(), myVehicles, and MSLane::removeParking().

Referenced by MSVehicle::onRemovalFromNet().

◆ saveState()

void MSVehicleTransfer::saveState ( OutputDevice out)

Field Documentation

◆ myInstance

MSVehicleTransfer * MSVehicleTransfer::myInstance = nullptr
staticprotected

The static singleton-instance.

Definition at line 153 of file MSVehicleTransfer.h.

Referenced by getInstance(), and ~MSVehicleTransfer().

◆ myVehicles

FXSynchQue<VehicleInformation, std::vector<VehicleInformation> > MSVehicleTransfer::myVehicles
protected

The information about stored vehicles to move virtually.

Definition at line 150 of file MSVehicleTransfer.h.

Referenced by add(), checkInsertions(), loadState(), remove(), and saveState().

◆ TeleportMinSpeed

const double MSVehicleTransfer::TeleportMinSpeed = 1
static

The minimum speed while teleporting.

Definition at line 114 of file MSVehicleTransfer.h.

Referenced by checkInsertions().


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