Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSVehicleTransfer Class Reference

#include <MSVehicleTransfer.h>

Collaboration diagram for MSVehicleTransfer:
[legend]

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.
 
void checkInsertions (SUMOTime time)
 Checks "movement" of stored vehicles.
 
void clearState ()
 Remove all vehicles before quick-loading state.
 
void loadState (const SUMOSAXAttributes &attrs, const SUMOTime offset, MSVehicleControl &vc)
 Loads one transfer vehicle state from the given descriptionn.
 
void remove (MSVehicle *veh)
 Remove a vehicle from this transfer object.
 
void saveState (OutputDevice &out)
 Saves the current state into the given stream.
 
virtual ~MSVehicleTransfer ()
 Destructor.
 

Static Public Member Functions

static MSVehicleTransfergetInstance ()
 Returns the instance of this object.
 

Static Public Attributes

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

Protected Attributes

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

Static Protected Attributes

static MSVehicleTransfermyInstance = nullptr
 The static singleton-instance.
 

Private Member Functions

 MSVehicleTransfer ()
 Constructor.
 

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 61 of file MSVehicleTransfer.h.

Constructor & Destructor Documentation

◆ ~MSVehicleTransfer()

MSVehicleTransfer::~MSVehicleTransfer ( )
virtual

Destructor.

Definition at line 223 of file MSVehicleTransfer.cpp.

References myInstance.

◆ MSVehicleTransfer()

MSVehicleTransfer::MSVehicleTransfer ( )
private

Constructor.

Definition at line 220 of file MSVehicleTransfer.cpp.

Referenced by getInstance().

Here is the caller graph for this function:

Member Function Documentation

◆ add()

void MSVehicleTransfer::add ( const SUMOTime  t,
MSVehicle veh 
)

Adds a vehicle to this transfer object.

The vehicle is removed from the network as it would end the trip. If the vehicle's next edge is his last one, the vehicle is also removed from the vehicle control.

Parameters
[in]vehThe vehicle to add

Definition at line 55 of file MSVehicleTransfer.cpp.

References MSAbstractLaneChangeModel::endLaneChangeManeuver(), MSVehicle::enterLaneAtMove(), MSBaseVehicle::getEdge(), Named::getID(), MSNet::getInstance(), MSVehicle::getLaneChangeModel(), MSEdge::getLanes(), MSBaseVehicle::getPastStops(), MSNet::getVehicleControl(), MSNet::informVehicleStateListener(), MSBaseVehicle::isJumping(), MSBaseVehicle::isParking(), myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSVehicle::onRemovalFromNet(), MSVehicleControl::scheduleVehicleRemoval(), MSNet::STARTING_PARKING, MSNet::STARTING_TELEPORT, MSBaseVehicle::succEdge(), time2string(), TL, and WRITE_WARNINGF.

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

Here is the caller graph for this function:

◆ 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 its route

Parameters
[in]timeThe current simulation time

Definition at line 95 of file MSVehicleTransfer.cpp.

References MSEdge::allowedLanes(), MSVehicle::computeAngle(), MSNet::ENDING_PARKING, MSNet::ENDING_TELEPORT, MSVehicle::enterLaneAtMove(), MSLane::freeInsertion(), MSLane::getBidiLane(), MSBaseVehicle::getCurrentParkingArea(), MSEdge::getCurrentTravelTime(), MSBaseVehicle::getEdge(), MSEdge::getFreeLane(), Named::getID(), MSParkingArea::getInsertionPosition(), MSNet::getInstance(), MSVehicle::getLane(), MSEdge::getLanes(), MSVehicle::getLateralPositionOnLane(), MSBaseVehicle::getMaxSpeed(), MSVehicle::getMutableLane(), MSVehicle::getPositionOnLane(), MSLane::getSpeedLimit(), MSVehicleType::getVehicleClass(), MSNet::getVehicleControl(), MSLane::getVehicleNumberWithPartials(), MSLane::getVehiclesSecure(), MSBaseVehicle::getVehicleType(), MSLane::getWidth(), MSGlobals::gLefthand, MSGlobals::gModelParkingManoeuver, MSNet::informVehicleStateListener(), MSVehicle::invalidateCachedPosition(), MSLane::isInsertionSuccess(), MSVehicle::keepStopping(), MSVehicle::leaveLane(), MSNet::MANEUVERING, MIN2(), MSVehicleTransfer::VehicleInformation::myJumping, MSVehicleTransfer::VehicleInformation::myParking, MSVehicleTransfer::VehicleInformation::myProceedTime, MSVehicleTransfer::VehicleInformation::myTransferTime, MSVehicleTransfer::VehicleInformation::myVeh, myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSMoveReminder::NOTIFICATION_TELEPORT_CONTINUATION, MSParkingArea::notifyEgressBlocked(), MSVehicle::processNextStop(), MSLane::releaseVehicles(), MSLane::removeParking(), MSVehicleControl::scheduleVehicleRemoval(), MSVehicle::setExitManoeuvre(), MSVehicle::setIdling(), MSVehicle::setLateralPositionOnLane(), MSVehicle::signalSet(), MSBaseVehicle::succEdge(), MSVehicle::switchOnSignal(), TeleportMinSpeed, TIME2STEPS, time2string(), TL, MSVehicle::updateParkingState(), MSVehicle::VEH_SIGNAL_BLINKER_LEFT, MSVehicle::VEH_SIGNAL_BLINKER_RIGHT, MSVehicle::workOnIdleReminders(), and WRITE_WARNINGF.

Referenced by MSNet::simulationStep().

Here is the caller graph for this function:

◆ clearState()

void MSVehicleTransfer::clearState ( )

Remove all vehicles before quick-loading state.

Definition at line 247 of file MSVehicleTransfer.cpp.

References myVehicles.

Referenced by MSNet::clearState().

Here is the caller graph for this function:

◆ getInstance()

MSVehicleTransfer * MSVehicleTransfer::getInstance ( )
static

Returns the instance of this object.

Returns
The singleton instance

Definition at line 212 of file MSVehicleTransfer.cpp.

References MSVehicleTransfer(), and myInstance.

Referenced by MSNet::clearAll(), MSNet::clearState(), MSLane::detectCollisions(), MSLane::executeMovements(), LIBSUMO_NAMESPACE::Vehicle::moveTo(), MSStateHandler::myStartElement(), MSVehicle::onRemovalFromNet(), MSVehicle::Influencer::postProcessRemoteControl(), MSStateHandler::saveState(), and MSNet::simulationStep().

Here is the caller graph for this function:

◆ loadState()

void MSVehicleTransfer::loadState ( const SUMOSAXAttributes attrs,
const SUMOTime  offset,
MSVehicleControl vc 
)

◆ 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::getMutableLane(), myVehicles, and MSLane::removeParking().

Referenced by LIBSUMO_NAMESPACE::Vehicle::moveTo(), MSVehicle::onRemovalFromNet(), and MSVehicle::Influencer::postProcessRemoteControl().

Here is the caller graph for this function:

◆ saveState()

void MSVehicleTransfer::saveState ( OutputDevice out)

Saves the current state into the given stream.

Definition at line 229 of file MSVehicleTransfer.cpp.

References OutputDevice::closeTag(), myVehicles, OutputDevice::openTag(), SUMO_ATTR_DEPART, SUMO_ATTR_ID, SUMO_ATTR_JUMP, SUMO_ATTR_PARKING, SUMO_TAG_VEHICLETRANSFER, and OutputDevice::writeAttr().

Referenced by MSStateHandler::saveState().

Here is the caller graph for this function:

Field Documentation

◆ myInstance

MSVehicleTransfer * MSVehicleTransfer::myInstance = nullptr
staticprotected

The static singleton-instance.

Definition at line 155 of file MSVehicleTransfer.h.

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

◆ myVehicles

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

The information about stored vehicles to move virtually.

Definition at line 152 of file MSVehicleTransfer.h.

Referenced by add(), checkInsertions(), clearState(), 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: