SUMO - Simulation of Urban MObility
MSVehicleTransfer Class Reference

#include <MSVehicleTransfer.h>

Collaboration diagram for MSVehicleTransfer:
Collaboration graph

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...
 
const std::set< const MSVehicle * > & getParkingVehicles (const MSLane *lane) const
 return parking vehicles on the given lane More...
 
bool hasPending () const
 Checks whether stored vehicles are present. 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) const
 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 Types

typedef std::map< const MSLane *, std::set< const MSVehicle * > > ParkingVehicles
 The map from lanes to parking vehicles. More...
 
typedef std::vector< VehicleInformationVehicleInfVector
 Definition of a container for vehicle information. More...
 

Protected Attributes

ParkingVehicles myParkingVehicles
 
VehicleInfVector myVehicles
 The information about stored vehicles to move virtually. More...
 

Static Protected Attributes

static const std::set< const MSVehicle * > myEmptyVehicleSet
 an empty set for convenience More...
 
static MSVehicleTransfermyInstance = 0
 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 70 of file MSVehicleTransfer.h.

Member Typedef Documentation

◆ ParkingVehicles

typedef std::map<const MSLane*, std::set<const MSVehicle*> > MSVehicleTransfer::ParkingVehicles
protected

The map from lanes to parking vehicles.

Definition at line 167 of file MSVehicleTransfer.h.

◆ VehicleInfVector

Definition of a container for vehicle information.

Definition at line 161 of file MSVehicleTransfer.h.

Constructor & Destructor Documentation

◆ ~MSVehicleTransfer()

MSVehicleTransfer::~MSVehicleTransfer ( )
virtual

Destructor.

Definition at line 180 of file MSVehicleTransfer.cpp.

References myInstance.

◆ MSVehicleTransfer()

MSVehicleTransfer::MSVehicleTransfer ( )
private

Constructor.

Definition at line 177 of file MSVehicleTransfer.cpp.

Referenced by getInstance().

Member Function Documentation

◆ add()

◆ checkInsertions()

void MSVehicleTransfer::checkInsertions ( SUMOTime  time)

◆ getInstance()

MSVehicleTransfer * MSVehicleTransfer::getInstance ( void  )
static

◆ getParkingVehicles()

const std::set< const MSVehicle * > & MSVehicleTransfer::getParkingVehicles ( const MSLane lane) const

return parking vehicles on the given lane

Definition at line 186 of file MSVehicleTransfer.cpp.

References myEmptyVehicleSet, and myParkingVehicles.

Referenced by GUILane::drawGL().

◆ hasPending()

bool MSVehicleTransfer::hasPending ( ) const

Checks whether stored vehicles are present.

Returns
whether any vehicles wait for transfer

Definition at line 163 of file MSVehicleTransfer.cpp.

References myVehicles.

◆ 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 82 of file MSVehicleTransfer.cpp.

References MSVehicle::getLane(), myParkingVehicles, and myVehicles.

Referenced by MSVehicle::onRemovalFromNet().

◆ saveState()

void MSVehicleTransfer::saveState ( OutputDevice out) const

Field Documentation

◆ myEmptyVehicleSet

const std::set< const MSVehicle * > MSVehicleTransfer::myEmptyVehicleSet
staticprotected

an empty set for convenience

Definition at line 174 of file MSVehicleTransfer.h.

Referenced by getParkingVehicles().

◆ myInstance

MSVehicleTransfer * MSVehicleTransfer::myInstance = 0
staticprotected

The static singleton-instance.

Definition at line 171 of file MSVehicleTransfer.h.

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

◆ myParkingVehicles

ParkingVehicles MSVehicleTransfer::myParkingVehicles
protected

◆ myVehicles

VehicleInfVector MSVehicleTransfer::myVehicles
protected

The information about stored vehicles to move virtually.

Definition at line 164 of file MSVehicleTransfer.h.

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

◆ TeleportMinSpeed

const double MSVehicleTransfer::TeleportMinSpeed = 1
static

The minimum speed while teleporting.

Definition at line 129 of file MSVehicleTransfer.h.

Referenced by add(), and checkInsertions().


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