Eclipse 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. | |
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 MSVehicleTransfer * | getInstance () |
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 MSVehicleTransfer * | myInstance = nullptr |
The static singleton-instance. | |
Private Member Functions | |
MSVehicleTransfer () | |
Constructor. | |
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.
|
virtual |
|
private |
Constructor.
Definition at line 220 of file MSVehicleTransfer.cpp.
Referenced by getInstance().
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 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().
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
[in] | time | The 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().
void MSVehicleTransfer::clearState | ( | ) |
Remove all vehicles before quick-loading state.
Definition at line 247 of file MSVehicleTransfer.cpp.
References myVehicles.
Referenced by MSNet::clearState().
|
static |
Returns the instance of this object.
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().
void MSVehicleTransfer::loadState | ( | const SUMOSAXAttributes & | attrs, |
const SUMOTime | offset, | ||
MSVehicleControl & | vc | ||
) |
Loads one transfer vehicle state from the given descriptionn.
Definition at line 253 of file MSVehicleTransfer.cpp.
References MSLane::addParking(), MSInsertionControl::alreadyDeparted(), MSLane::dictionary(), Named::getID(), MSNet::getInsertionControl(), MSNet::getInstance(), SUMOSAXAttributes::getLong(), SUMOSAXAttributes::getOpt(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), SUMOSAXAttributes::getString(), MSVehicleControl::getVehicle(), SUMOSAXAttributes::hasAttribute(), myVehicles, MSVehicle::processNextStop(), MSVehicle::setTentativeLaneAndPosition(), SUMO_ATTR_DEPART, SUMO_ATTR_ID, SUMO_ATTR_JUMP, and SUMO_ATTR_PARKING.
Referenced by MSStateHandler::myStartElement().
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 79 of file MSVehicleTransfer.cpp.
References MSVehicle::getMutableLane(), myVehicles, and MSLane::removeParking().
Referenced by LIBSUMO_NAMESPACE::Vehicle::moveTo(), MSVehicle::onRemovalFromNet(), and MSVehicle::Influencer::postProcessRemoteControl().
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().
|
staticprotected |
The static singleton-instance.
Definition at line 155 of file MSVehicleTransfer.h.
Referenced by getInstance(), and ~MSVehicleTransfer().
|
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().
|
static |
The minimum speed while teleporting.
Definition at line 114 of file MSVehicleTransfer.h.
Referenced by checkInsertions().