|
SUMO - Simulation of Urban MObility
|
A route definition which has some alternatives, already. More...
#include <RORouteDef_Alternatives.h>
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 |
| Build the next 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 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 | removeLast () |
| RORouteDef_Alternatives (const std::string &id, unsigned int lastUsed, const SUMOReal beta, const SUMOReal gawronA, const SUMOReal logitGamma, 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. | |
Private Types | |
| typedef std::vector< RORoute * > | AlternativesVector |
| Definition of the storage for alternatives. | |
Private Member Functions | |
| void | calculateLogitProbabilities () |
| calculate the probabilities in the logit model | |
| int | findRoute (RORoute *opt) const |
| Searches for the route within the list of alternatives. | |
| SUMOReal | gawronF (SUMOReal pdr, SUMOReal pds, SUMOReal x) |
| Performs the gawron - f() function From "Dynamic User Equilibria...". | |
| SUMOReal | gawronG (SUMOReal a, SUMOReal x) |
| Performs the gawron - g() function From "Dynamic User Equilibria...". | |
| SUMOReal | getThetaForCLogit () const |
| calculate the scaling factor in the logit model | |
| 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 SUMOReal | myBeta |
| gawron or logit beta - value | |
| std::map< const RORoute *, SUMOReal > | myCommonalities |
| The route commonality factors for c-logit. | |
| const SUMOReal | myGawronA |
| gawron a - value | |
| const bool | myKeepRoutes |
| Information whether all routes should be saved. | |
| int | myLastUsed |
| Index of the route used within the last step. | |
| const SUMOReal | myLogitGamma |
| logit gamma - value | |
| 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 53 of file RORouteDef_Alternatives.h.
typedef std::vector<RORoute*> RORouteDef_Alternatives::AlternativesVector [private] |
Definition of the storage for alternatives.
Definition at line 112 of file RORouteDef_Alternatives.h.
| RORouteDef_Alternatives::~RORouteDef_Alternatives | ( | ) | [virtual] |
| RORouteDef_Alternatives::RORouteDef_Alternatives | ( | const RORouteDef_Alternatives & | src | ) | [private] |
Invalidated copy constructor.
| void RORouteDef_Alternatives::addAlternative | ( | SUMOAbstractRouter< ROEdge, ROVehicle > & | router, |
| const ROVehicle * const | veh, | ||
| RORoute * | current, | ||
| SUMOTime | begin | ||
| ) | [virtual] |
Adds a build alternative.
Implements RORouteDef.
Definition at line 132 of file RORouteDef_Alternatives.cpp.
References calculateLogitProbabilities(), gawronF(), RORoute::getCosts(), RORoute::getEdgeVector(), ROVehicle::getID(), Named::getID(), RORoute::getProbability(), ISNAN(), MAX2(), MIN2(), myAlternatives, myBeta, myKeepRoutes, myLastUsed, myLogitGamma, myNewRoute, RandHelper::rand(), SUMOAbstractRouter< E, V >::recomputeCosts(), RORoute::setCosts(), RORoute::setProbability(), and SUMOReal.
| void RORouteDef_Alternatives::addLoadedAlternative | ( | RORoute * | alternative | ) | [virtual] |
Adds an alternative loaded from the file An alternative may also be generated whicle DUA.
Definition at line 80 of file RORouteDef_Alternatives.cpp.
References myAlternatives.
Referenced by copy(), and RORDLoader_SUMOBase::myCharacters().
| RORoute * RORouteDef_Alternatives::buildCurrentRoute | ( | SUMOAbstractRouter< ROEdge, ROVehicle > & | router, |
| SUMOTime | begin, | ||
| const ROVehicle & | veh | ||
| ) | const [virtual] |
Build the next route.
Implements RORouteDef.
Definition at line 87 of file RORouteDef_Alternatives.cpp.
References SUMOAbstractRouter< E, V >::compute(), RORouteDef::copyColorIfGiven(), findRoute(), myAlternatives, Named::myID, myLastUsed, myLogitGamma, myNewRoute, mySkipRouteCalculation, SUMOAbstractRouter< E, V >::recomputeCosts(), RORoute::setCosts(), and SUMOReal.
| void RORouteDef_Alternatives::calculateLogitProbabilities | ( | ) | [private] |
calculate the probabilities in the logit model
Definition at line 251 of file RORouteDef_Alternatives.cpp.
References RORoute::getCosts(), RORoute::getEdgeVector(), getThetaForCLogit(), myAlternatives, myBeta, myCommonalities, myLogitGamma, RORoute::setProbability(), and SUMOReal.
Referenced by addAlternative().
| RORouteDef * RORouteDef_Alternatives::copy | ( | const std::string & | id | ) | const [virtual] |
Returns a copy of the route definition.
Implements RORouteDef.
Definition at line 311 of file RORouteDef_Alternatives.cpp.
References addLoadedAlternative(), myAlternatives, myBeta, myGawronA, myKeepRoutes, myLastUsed, myLogitGamma, myMaxRouteNumber, mySkipRouteCalculation, and RORouteDef_Alternatives().
| const RGBColor * RORouteDef::copyColorIfGiven | ( | ) | const [protected, inherited] |
Definition at line 65 of file RORouteDef.cpp.
References RORouteDef::myColor.
Referenced by RORouteDef_OrigDest::buildCurrentRoute(), RORouteDef_Complete::buildCurrentRoute(), buildCurrentRoute(), RORouteDef_OrigDest::copy(), and RORouteDef_Complete::copy().
| int RORouteDef_Alternatives::findRoute | ( | RORoute * | opt | ) | const [private] |
Searches for the route within the list of alternatives.
Definition at line 121 of file RORouteDef_Alternatives.cpp.
References RORoute::getEdgeVector(), and myAlternatives.
Referenced by buildCurrentRoute().
| SUMOReal RORouteDef_Alternatives::gawronF | ( | SUMOReal | pdr, |
| SUMOReal | pds, | ||
| SUMOReal | x | ||
| ) | [private] |
Performs the gawron - f() function From "Dynamic User Equilibria...".
Definition at line 292 of file RORouteDef_Alternatives.cpp.
References gawronG(), max, and myGawronA.
Referenced by addAlternative().
| SUMOReal RORouteDef_Alternatives::gawronG | ( | SUMOReal | a, |
| SUMOReal | x | ||
| ) | [private] |
Performs the gawron - g() function From "Dynamic User Equilibria...".
Definition at line 302 of file RORouteDef_Alternatives.cpp.
Referenced by gawronF().
| const RGBColor* RORouteDef::getColor | ( | ) | const [inline, inherited] |
Returns the color of the route.
Definition at line 94 of file RORouteDef.h.
References RORouteDef::myColor.
| const std::string& Named::getID | ( | ) | const [inline, inherited] |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 61 of file Named.h.
References Named::myID.
Referenced by ShapeContainer::add(), MSDetectorControl::add(), addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::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(), RORouteDef_Complete::buildCurrentRoute(), 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(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBNodeCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBDistrictCont::insert(), NBNodeCont::joinJunctions(), 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(), MSTriggeredRerouter::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), Named::ComparatorIdLess::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(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::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().
| SUMOReal RORouteDef_Alternatives::getThetaForCLogit | ( | ) | const [private] |
calculate the scaling factor in the logit model
Definition at line 227 of file RORouteDef_Alternatives.cpp.
References max, min, myAlternatives, PI, and SUMOReal.
Referenced by calculateLogitProbabilities().
| void RORouteDef_Alternatives::invalidateLast | ( | ) |
Definition at line 322 of file RORouteDef_Alternatives.cpp.
References myLastUsed.
| bool ReferencedItem::isSaved | ( | ) | const [inline, inherited] |
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().
| void ReferencedItem::markSaved | ( | ) | [inline, inherited] |
Marks the item as saved.
Definition at line 66 of file ReferencedItem.h.
References ReferencedItem::myWasSaved.
| RORouteDef_Alternatives& RORouteDef_Alternatives::operator= | ( | const RORouteDef_Alternatives & | src | ) | [private] |
Invalidated assignment operator.
| void RORouteDef_Alternatives::removeLast | ( | ) |
Definition at line 328 of file RORouteDef_Alternatives.cpp.
References myAlternatives, and myLastUsed.
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
| OutputDevice & RORouteDef_Alternatives::writeXMLDefinition | ( | SUMOAbstractRouter< ROEdge, ROVehicle > & | router, |
| OutputDevice & | dev, | ||
| const ROVehicle *const | veh, | ||
| bool | asAlternatives, | ||
| bool | withExitTimes | ||
| ) | const [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 337 of file RORouteDef_Alternatives.cpp.
References OutputDevice::closeTag(), RORoute::getColor(), RORoute::getCosts(), ROVehicle::getDepartureTime(), RORoute::getEdgeVector(), RORoute::getProbability(), myAlternatives, RORouteDef::myColor, myLastUsed, OutputDevice::openTag(), OutputDevice::setPrecision(), STEPS2TIME, and SUMOReal.
The alternatives.
Definition at line 115 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), addLoadedAlternative(), buildCurrentRoute(), calculateLogitProbabilities(), copy(), findRoute(), getThetaForCLogit(), removeLast(), writeXMLDefinition(), and ~RORouteDef_Alternatives().
const SUMOReal RORouteDef_Alternatives::myBeta [private] |
gawron or logit beta - value
Definition at line 118 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), calculateLogitProbabilities(), and copy().
const RGBColor* const RORouteDef::myColor [protected, inherited] |
The color the route shall have.
Definition at line 116 of file RORouteDef.h.
Referenced by RORouteDef::copyColorIfGiven(), RORouteDef::getColor(), RORouteDef_Complete::writeXMLDefinition(), writeXMLDefinition(), and RORouteDef::~RORouteDef().
std::map<const RORoute*, SUMOReal> RORouteDef_Alternatives::myCommonalities [private] |
The route commonality factors for c-logit.
Definition at line 127 of file RORouteDef_Alternatives.h.
Referenced by calculateLogitProbabilities().
const SUMOReal RORouteDef_Alternatives::myGawronA [private] |
gawron a - value
Definition at line 121 of file RORouteDef_Alternatives.h.
std::string Named::myID [protected, inherited] |
The name of the object.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 83 of file Named.h.
Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), RORouteDef_OrigDest::buildCurrentRoute(), RORouteDef_Complete::buildCurrentRoute(), buildCurrentRoute(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSMeanData::writeXMLOutput(), and MSE3Collector::writeXMLOutput().
const bool RORouteDef_Alternatives::myKeepRoutes [private] |
Information whether all routes should be saved.
Definition at line 133 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), and copy().
int RORouteDef_Alternatives::myLastUsed [mutable, private] |
Index of the route used within the last step.
Definition at line 109 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), buildCurrentRoute(), copy(), invalidateLast(), removeLast(), and writeXMLDefinition().
const SUMOReal RORouteDef_Alternatives::myLogitGamma [private] |
logit gamma - value
Definition at line 124 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), buildCurrentRoute(), calculateLogitProbabilities(), and copy().
const int RORouteDef_Alternatives::myMaxRouteNumber [private] |
The maximum route number.
Definition at line 130 of file RORouteDef_Alternatives.h.
Referenced by copy().
bool RORouteDef_Alternatives::myNewRoute [mutable, private] |
Information whether a new route was generated.
Definition at line 106 of file RORouteDef_Alternatives.h.
Referenced by addAlternative(), and buildCurrentRoute().
const bool RORouteDef_Alternatives::mySkipRouteCalculation [private] |
Information whether new routes should be calculated.
Definition at line 136 of file RORouteDef_Alternatives.h.
Referenced by buildCurrentRoute(), and copy().