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

#include <MSVehicleTransfer.h>

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.
const std::set< const
MSVehicle * > & 
getParkingVehicles (const MSLane *lane) const
 return parking vehicles on the given lane
bool hasPending () const
 Checks whether stored vehicles are present.
void remove (MSVehicle *veh)
 Remove a vehicle from this transfer object.
virtual ~MSVehicleTransfer ()
 Destructor.

Static Public Member Functions

static MSVehicleTransfergetInstance ()
 Returns the instance of this object.

Static Public Attributes

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

Protected Types

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

Protected Attributes

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

Static Protected Attributes

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

Member Typedef Documentation

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

The map from lanes to parking vehicles.

Definition at line 159 of file MSVehicleTransfer.h.

Definition of a container for vehicle information.

Definition at line 153 of file MSVehicleTransfer.h.

Constructor & Destructor Documentation

MSVehicleTransfer::~MSVehicleTransfer ( )
virtual

Destructor.

Definition at line 176 of file MSVehicleTransfer.cpp.

References myInstance.

MSVehicleTransfer::MSVehicleTransfer ( )
private

Constructor.

Definition at line 173 of file MSVehicleTransfer.cpp.

Referenced by getInstance().

Member Function Documentation

MSVehicleTransfer * MSVehicleTransfer::getInstance ( void  )
static

Returns the instance of this object.

Returns
The singleton instance

Definition at line 165 of file MSVehicleTransfer.cpp.

References MSVehicleTransfer(), and myInstance.

Referenced by add(), checkInsertions(), MSLane::detectCollisions(), GUILane::drawGL(), MSLane::executeMovements(), and MSVehicle::onRemovalFromNet().

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

return parking vehicles on the given lane

Definition at line 182 of file MSVehicleTransfer.cpp.

References myEmptyVehicleSet, and myParkingVehicles.

Referenced by GUILane::drawGL().

bool MSVehicleTransfer::hasPending ( ) const

Checks whether stored vehicles are present.

Returns
whether any vehicles wait for transfer

Definition at line 159 of file MSVehicleTransfer.cpp.

References myVehicles.

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

References myVehicles.

Referenced by MSVehicle::onRemovalFromNet().

Field Documentation

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

an empty set for convenience

Definition at line 166 of file MSVehicleTransfer.h.

Referenced by getParkingVehicles().

MSVehicleTransfer * MSVehicleTransfer::myInstance = 0
staticprotected

The static singleton-instance.

Definition at line 163 of file MSVehicleTransfer.h.

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

ParkingVehicles MSVehicleTransfer::myParkingVehicles
protected

Definition at line 160 of file MSVehicleTransfer.h.

Referenced by add(), checkInsertions(), and getParkingVehicles().

VehicleInfVector MSVehicleTransfer::myVehicles
protected

The information about stored vehicles to move virtually.

Definition at line 156 of file MSVehicleTransfer.h.

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

const SUMOReal MSVehicleTransfer::TeleportMinSpeed = 1
static

The minimum speed while teleporting.

Definition at line 121 of file MSVehicleTransfer.h.

Referenced by add(), and checkInsertions().


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