SUMO - Simulation of Urban MObility
|
A route definition which has some alternatives, already. More...
#include <RORouteDef_Alternatives.h>
Data Structures | |
struct | ComparatorProbability |
Public Member Functions | |
void | addAlternative (SUMOAbstractRouter< ROEdge, ROVehicle > &router, const ROVehicle *const, RORoute *current, SUMOTime begin) |
Adds a build alternative. | |
virtual void | addLoadedAlternative (RORoute *alternative) |
Adds an alternative loaded from the file An alternative may also be generated whicle DUA. | |
RORoute * | buildCurrentRoute (SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh) const |
Triggers building of the complete route (via preComputeCurrentRoute) or returns precomputed route. | |
RORouteDef * | copy (const std::string &id) const |
Returns a copy of the route definition. | |
const RGBColor * | getColor () const |
Returns the color of the route. | |
const ROEdge * | getDestination () const |
const std::string & | getID () const |
Returns the id. | |
void | invalidateLast () |
bool | isSaved () const |
Returns the information whether this item was already saved. | |
void | markSaved () |
Marks the item as saved. | |
void | preComputeCurrentRoute (SUMOAbstractRouter< ROEdge, ROVehicle > &router, SUMOTime begin, const ROVehicle &veh) const |
Build the next route. | |
void | removeLast () |
RORouteDef_Alternatives (const std::string &id, unsigned int lastUsed, const int maxRoutes, const bool keepRoutes, const bool skipRouteCalculation) | |
Constructor. | |
void | setID (const std::string &newID) |
resets the id | |
virtual OutputDevice & | writeXMLDefinition (SUMOAbstractRouter< ROEdge, ROVehicle > &router, OutputDevice &dev, const ROVehicle *const veh, bool asAlternatives, bool withExitTimes) const |
Saves the built route / route alternatives. | |
virtual | ~RORouteDef_Alternatives () |
Destructor. |
Protected Member Functions | |
const RGBColor * | copyColorIfGiven () const |
Protected Attributes | |
const RGBColor *const | myColor |
The color the route shall have. | |
std::string | myID |
The name of the object. | |
RORoute * | myPrecomputed |
precomputed route for out-of-order computation |
Private Types | |
typedef std::vector< RORoute * > | AlternativesVector |
Definition of the storage for alternatives. |
Private Member Functions | |
int | findRoute (RORoute *opt) const |
Searches for the route within the list of alternatives. | |
RORouteDef_Alternatives & | operator= (const RORouteDef_Alternatives &src) |
Invalidated assignment operator. | |
RORouteDef_Alternatives (const RORouteDef_Alternatives &src) | |
Invalidated copy constructor. |
Private Attributes | |
AlternativesVector | myAlternatives |
The alternatives. | |
const bool | myKeepRoutes |
Information whether all routes should be saved. | |
int | myLastUsed |
Index of the route used within the last step. | |
const int | myMaxRouteNumber |
The maximum route number. | |
bool | myNewRoute |
Information whether a new route was generated. | |
const bool | mySkipRouteCalculation |
Information whether new routes should be calculated. |
A route definition which has some alternatives, already.
Definition at line 52 of file RORouteDef_Alternatives.h.
|
private |
Definition of the storage for alternatives.
Definition at line 106 of file RORouteDef_Alternatives.h.
|
virtual |
|
private |
Invalidated copy constructor.
|
virtual |
Adds a build alternative.
Implements RORouteDef.
Definition at line 115 of file RORouteDef_Alternatives.cpp.
References ROCostCalculator::calculateProbabilities(), ROCostCalculator::getCalculator(), RORoute::getEdgeVector(), Named::getID(), ROVehicle::getID(), RORoute::getProbability(), myAlternatives, myKeepRoutes, myLastUsed, myMaxRouteNumber, myNewRoute, RandHelper::rand(), SUMOAbstractRouter< E, V >::recomputeCosts(), ROCostCalculator::setCosts(), RORoute::setProbability(), and SUMOReal.
|
virtual |
Adds an alternative loaded from the file An alternative may also be generated whicle DUA.
Definition at line 66 of file RORouteDef_Alternatives.cpp.
References myAlternatives.
Referenced by copy(), and RORDLoader_SUMOBase::myCharacters().
|
inherited |
Triggers building of the complete route (via preComputeCurrentRoute) or returns precomputed route.
Definition at line 77 of file RORouteDef.cpp.
References RORouteDef::myPrecomputed, and RORouteDef::preComputeCurrentRoute().
Referenced by RONet::computeRoute().
|
virtual |
Returns a copy of the route definition.
Implements RORouteDef.
Definition at line 193 of file RORouteDef_Alternatives.cpp.
References addLoadedAlternative(), myAlternatives, myKeepRoutes, myLastUsed, myMaxRouteNumber, mySkipRouteCalculation, and RORouteDef_Alternatives().
|
protectedinherited |
Definition at line 68 of file RORouteDef.cpp.
References RORouteDef::myColor.
Referenced by RORouteDef_OrigDest::copy(), RORouteDef_Complete::copy(), RORouteDef_OrigDest::preComputeCurrentRoute(), preComputeCurrentRoute(), and RORouteDef_Complete::preComputeCurrentRoute().
Searches for the route within the list of alternatives.
Definition at line 104 of file RORouteDef_Alternatives.cpp.
References RORoute::getEdgeVector(), and myAlternatives.
Referenced by preComputeCurrentRoute().
|
inlineinherited |
Returns the color of the route.
Definition at line 98 of file RORouteDef.h.
References RORouteDef::myColor.
|
virtual |
Implements RORouteDef.
Definition at line 260 of file RORouteDef_Alternatives.cpp.
References myAlternatives.
|
inlineinherited |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 61 of file Named.h.
References Named::myID.
Referenced by MSDetectorControl::add(), ShapeContainer::add(), addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), NBLoadedTLDef::SignalGroup::patchTYellow(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
void RORouteDef_Alternatives::invalidateLast | ( | ) |
Definition at line 204 of file RORouteDef_Alternatives.cpp.
References myLastUsed.
|
inlineinherited |
Returns the information whether this item was already saved.
Definition at line 59 of file ReferencedItem.h.
References ReferencedItem::myWasSaved.
Referenced by RONet::computeRoute(), and ROVehicle::saveAllAsXML().
|
inlineinherited |
Marks the item as saved.
Definition at line 66 of file ReferencedItem.h.
References ReferencedItem::myWasSaved.
|
private |
Invalidated assignment operator.
|
virtual |
Build the next route.
Implements RORouteDef.
Definition at line 72 of file RORouteDef_Alternatives.cpp.
References SUMOAbstractRouter< E, V >::compute(), RORouteDef::copyColorIfGiven(), findRoute(), ROCostCalculator::getCalculator(), myAlternatives, Named::myID, myLastUsed, myNewRoute, RORouteDef::myPrecomputed, mySkipRouteCalculation, SUMOAbstractRouter< E, V >::recomputeCosts(), ROCostCalculator::setCosts(), and SUMOReal.
void RORouteDef_Alternatives::removeLast | ( | ) |
Definition at line 210 of file RORouteDef_Alternatives.cpp.
References myAlternatives, and myLastUsed.
|
inlineinherited |
resets the id
Definition at line 67 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
virtual |
Saves the built route / route alternatives.
Writes the route into the given stream.
[in] | dev | The device to write the route into |
[in] | asAlternatives | Whether the route shall be saved as route alternatives |
Implements RORouteDef.
Definition at line 219 of file RORouteDef_Alternatives.cpp.
References OutputDevice::closeOpener(), OutputDevice::closeTag(), RORoute::getColor(), RORoute::getCosts(), ROVehicle::getDepartureTime(), RORoute::getEdgeVector(), RORoute::getProbability(), myAlternatives, RORouteDef::myColor, myLastUsed, OutputDevice::openTag(), OutputDevice::setPrecision(), STEPS2TIME, SUMO_ATTR_COLOR, SUMO_ATTR_COST, SUMO_ATTR_EDGES, SUMO_ATTR_LAST, SUMO_ATTR_PROB, SUMO_TAG_ROUTE, SUMO_TAG_ROUTE_DISTRIBUTION, SUMOReal, toString(), and OutputDevice::writeAttr().
|
private |
The alternatives.
Definition at line 109 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), addLoadedAlternative(), copy(), findRoute(), getDestination(), preComputeCurrentRoute(), removeLast(), writeXMLDefinition(), and ~RORouteDef_Alternatives().
|
protectedinherited |
The color the route shall have.
Definition at line 121 of file RORouteDef.h.
Referenced by RORouteDef::copyColorIfGiven(), RORouteDef::getColor(), RORouteDef_Complete::writeXMLDefinition(), writeXMLDefinition(), and RORouteDef::~RORouteDef().
|
protectedinherited |
The name of the object.
Definition at line 83 of file Named.h.
Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), RORouteDef_OrigDest::preComputeCurrentRoute(), preComputeCurrentRoute(), RORouteDef_Complete::preComputeCurrentRoute(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSE3Collector::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
private |
Information whether all routes should be saved.
Definition at line 115 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), and copy().
|
mutableprivate |
Index of the route used within the last step.
Definition at line 103 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), copy(), invalidateLast(), preComputeCurrentRoute(), removeLast(), and writeXMLDefinition().
|
private |
The maximum route number.
Definition at line 112 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), and copy().
|
mutableprivate |
Information whether a new route was generated.
Definition at line 100 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), and preComputeCurrentRoute().
|
mutableprotectedinherited |
precomputed route for out-of-order computation
Definition at line 124 of file RORouteDef.h.
Referenced by RORouteDef::buildCurrentRoute(), RORouteDef_OrigDest::preComputeCurrentRoute(), preComputeCurrentRoute(), and RORouteDef_Complete::preComputeCurrentRoute().
|
private |
Information whether new routes should be calculated.
Definition at line 118 of file RORouteDef_Alternatives.h.
Referenced by copy(), and preComputeCurrentRoute().