SUMO - Simulation of Urban MObility

RORouteDef_Alternatives Class Reference

A route definition which has some alternatives, already. More...

#include <RORouteDef_Alternatives.h>

Inheritance diagram for RORouteDef_Alternatives:
RORouteDef ReferencedItem Named

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.

Detailed Description

A route definition which has some alternatives, already.

Definition at line 53 of file RORouteDef_Alternatives.h.


Member Typedef Documentation

typedef std::vector<RORoute*> RORouteDef_Alternatives::AlternativesVector [private]

Definition of the storage for alternatives.

Definition at line 112 of file RORouteDef_Alternatives.h.


Constructor & Destructor Documentation

RORouteDef_Alternatives::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.

Definition at line 61 of file RORouteDef_Alternatives.cpp.

Referenced by copy().

RORouteDef_Alternatives::~RORouteDef_Alternatives ( ) [virtual]

Destructor.

Definition at line 72 of file RORouteDef_Alternatives.cpp.

References myAlternatives.

RORouteDef_Alternatives::RORouteDef_Alternatives ( const RORouteDef_Alternatives &  src) [private]

Invalidated copy constructor.


Member Function Documentation

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]
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]
const RGBColor * RORouteDef::copyColorIfGiven ( ) const [protected, inherited]
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.

References max, and SUMOReal.

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.

Returns:
The stored 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.

Returns:
Whether this item was 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]

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

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.

Parameters:
[in]devThe device to write the route into
[in]asAlternativesWhether the route shall be saved as route alternatives
Returns:
The same device for further usage

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.


Field Documentation

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

Referenced by copy(), and gawronF().

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().

The maximum route number.

Definition at line 130 of file RORouteDef_Alternatives.h.

Referenced by copy().

Information whether a new route was generated.

Definition at line 106 of file RORouteDef_Alternatives.h.

Referenced by addAlternative(), and buildCurrentRoute().

Information whether new routes should be calculated.

Definition at line 136 of file RORouteDef_Alternatives.h.

Referenced by buildCurrentRoute(), and copy().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines