SUMO - Simulation of Urban MObility
|
#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. 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 | remove (MSVehicle *veh) |
Remove a vehicle from this transfer object. More... | |
virtual | ~MSVehicleTransfer () |
Destructor. More... | |
Static Public Member Functions | |
static MSVehicleTransfer * | getInstance () |
Returns the instance of this object. More... | |
Static Public Attributes | |
static const SUMOReal | 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< VehicleInformation > | VehicleInfVector |
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 MSVehicleTransfer * | myInstance = 0 |
The static singleton-instance. More... | |
Private Member Functions | |
MSVehicleTransfer () | |
Constructor. More... | |
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.
|
protected |
The map from lanes to parking vehicles.
Definition at line 159 of file MSVehicleTransfer.h.
|
protected |
Definition of a container for vehicle information.
Definition at line 153 of file MSVehicleTransfer.h.
|
virtual |
|
private |
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.
[in] | veh | The vehicle to add |
Definition at line 59 of file MSVehicleTransfer.cpp.
References MSAbstractLaneChangeModel::endLaneChangeManeuver(), MSVehicle::enterLaneAtMove(), MSEdge::getCurrentTravelTime(), MSBaseVehicle::getEdge(), Named::getID(), MSBaseVehicle::getID(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSEdge::getLanes(), MSNet::getVehicleControl(), MSNet::informVehicleStateListener(), MSVehicle::isParking(), myParkingVehicles, myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSVehicle::onRemovalFromNet(), MSVehicleControl::scheduleVehicleRemoval(), MSBaseVehicle::succEdge(), TeleportMinSpeed, TIME2STEPS, time2string(), MSNet::VEHICLE_STATE_STARTING_PARKING, MSNet::VEHICLE_STATE_STARTING_TELEPORT, and WRITE_WARNING.
Referenced by MSLane::executeMovements(), and MSLane::handleCollision().
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
[in] | time | The current simulation time |
Definition at line 94 of file MSVehicleTransfer.cpp.
References MSEdge::allowedLanes(), MSVehicle::enterLaneAtMove(), MSLane::freeInsertion(), MSEdge::getCurrentTravelTime(), MSBaseVehicle::getEdge(), MSEdge::getFreeLane(), Named::getID(), MSBaseVehicle::getID(), MSNet::getInstance(), MSVehicle::getLane(), MSEdge::getLanes(), MSBaseVehicle::getMaxSpeed(), MSVehicle::getPositionOnLane(), MSLane::getSpeedLimit(), MSVehicleType::getVehicleClass(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), MSNet::informVehicleStateListener(), MSLane::isInsertionSuccess(), MSVehicle::leaveLane(), MIN2(), MSVehicleTransfer::VehicleInformation::myParking, myParkingVehicles, MSVehicleTransfer::VehicleInformation::myProceedTime, MSVehicleTransfer::VehicleInformation::myVeh, myVehicles, MSMoveReminder::NOTIFICATION_PARKING, MSMoveReminder::NOTIFICATION_TELEPORT, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, MSVehicle::processNextStop(), MSVehicleControl::scheduleVehicleRemoval(), MSBaseVehicle::succEdge(), TeleportMinSpeed, TIME2STEPS, time2string(), MSNet::VEHICLE_STATE_ENDING_PARKING, MSNet::VEHICLE_STATE_ENDING_TELEPORT, and WRITE_WARNING.
Referenced by MSNet::simulationStep().
|
static |
Returns the instance of this object.
Definition at line 166 of file MSVehicleTransfer.cpp.
References MSVehicleTransfer(), and myInstance.
Referenced by MSNet::clearAll(), GUILane::drawGL(), MSLane::executeMovements(), MSLane::handleCollision(), MSVehicle::onRemovalFromNet(), and MSNet::simulationStep().
const std::set< const MSVehicle * > & MSVehicleTransfer::getParkingVehicles | ( | const MSLane * | lane | ) | const |
return parking vehicles on the given lane
Definition at line 183 of file MSVehicleTransfer.cpp.
References myEmptyVehicleSet, and myParkingVehicles.
Referenced by GUILane::drawGL().
bool MSVehicleTransfer::hasPending | ( | ) | const |
Checks whether stored vehicles are present.
Definition at line 160 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.
[in] | veh | The vehicle to remove |
Definition at line 83 of file MSVehicleTransfer.cpp.
References myVehicles.
Referenced by MSVehicle::onRemovalFromNet().
|
staticprotected |
an empty set for convenience
Definition at line 166 of file MSVehicleTransfer.h.
Referenced by getParkingVehicles().
|
staticprotected |
The static singleton-instance.
Definition at line 163 of file MSVehicleTransfer.h.
Referenced by getInstance(), and ~MSVehicleTransfer().
|
protected |
Definition at line 160 of file MSVehicleTransfer.h.
Referenced by add(), checkInsertions(), and getParkingVehicles().
|
protected |
The information about stored vehicles to move virtually.
Definition at line 156 of file MSVehicleTransfer.h.
Referenced by add(), checkInsertions(), hasPending(), and remove().
|
static |
The minimum speed while teleporting.
Definition at line 121 of file MSVehicleTransfer.h.
Referenced by add(), and checkInsertions().