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 addVeh (const SUMOTime t, MSVehicle *veh)
 Adds a vehicle to this transfer object.
void checkInsertions (SUMOTime time)
 Checks "movement" of stored vehicles.
bool hasPending () const
 Checks whether stored vehicles are present.
virtual ~MSVehicleTransfer ()
 Destructor.

Static Public Member Functions

static MSVehicleTransfergetInstance ()
 Returns the instance of this object.

Protected Types

typedef std::vector
< VehicleInformation
VehicleInfVector
 Definition of a container for vehicle information.

Protected Attributes

VehicleInfVector myVehicles
 The information about stored vehicles to move virtually.

Static Protected Attributes

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 addVeh 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.

Member Typedef Documentation

Definition of a container for vehicle information.

Definition at line 135 of file MSVehicleTransfer.h.

Constructor & Destructor Documentation

MSVehicleTransfer::~MSVehicleTransfer ( )
virtual

Destructor.

Definition at line 158 of file MSVehicleTransfer.cpp.

References myInstance.

MSVehicleTransfer::MSVehicleTransfer ( )
private

Constructor.

Definition at line 155 of file MSVehicleTransfer.cpp.

Referenced by getInstance().

Member Function Documentation

void MSVehicleTransfer::addVeh ( 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 58 of file MSVehicleTransfer.cpp.

References MSVehicle::enterLaneAtMove(), MSEdge::getCurrentTravelTime(), MSBaseVehicle::getEdge(), getInstance(), MSEdge::getLanes(), MSVehicle::isParking(), myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSVehicle::onRemovalFromNet(), MSBaseVehicle::succEdge(), TIME2STEPS, and MSNet::VEHICLE_STATE_STARTING_TELEPORT.

Referenced by MSLane::detectCollisions(), MSLane::moveCritical(), and MSLane::setCritical().

MSVehicleTransfer * MSVehicleTransfer::getInstance ( void  )
static

Returns the instance of this object.

Returns
The singleton instance

Definition at line 147 of file MSVehicleTransfer.cpp.

References MSVehicleTransfer(), and myInstance.

Referenced by addVeh(), checkInsertions(), MSLane::detectCollisions(), MSLane::moveCritical(), and MSLane::setCritical().

bool MSVehicleTransfer::hasPending ( ) const

Checks whether stored vehicles are present.

Returns
whether any vehicles wait for transfer

Definition at line 141 of file MSVehicleTransfer.cpp.

References myVehicles.

Field Documentation

MSVehicleTransfer * MSVehicleTransfer::myInstance = 0
staticprotected

The static singleton-instance.

Definition at line 141 of file MSVehicleTransfer.h.

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

VehicleInfVector MSVehicleTransfer::myVehicles
protected

The information about stored vehicles to move virtually.

Definition at line 138 of file MSVehicleTransfer.h.

Referenced by addVeh(), checkInsertions(), and hasPending().


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