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 throw ()
 Returns the information whether this item was already saved.
void markSaved () throw ()
 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) throw ()
 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 () throw ()
 Destructor.

Protected Member Functions

const RGBColor * copyColorIfGiven () const throw ()

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 51 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 110 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 
) throw ()

Constructor.

Definition at line 59 of file RORouteDef_Alternatives.cpp.

Referenced by copy().

RORouteDef_Alternatives::~RORouteDef_Alternatives ( ) throw () [virtual]

Destructor.

Definition at line 70 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 78 of file RORouteDef_Alternatives.cpp.

References myAlternatives.

Referenced by copy().

void RORouteDef_Alternatives::calculateLogitProbabilities ( ) [private]

calculate the probabilities in the logit model

Definition at line 241 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 throw () [protected, inherited]
int RORouteDef_Alternatives::findRoute ( RORoute *  opt) const [private]

Searches for the route within the list of alternatives.

Definition at line 115 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 282 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 292 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 92 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 59 of file Named.h.

References Named::myID.

Referenced by addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), NIImporter_SUMO::addPhase(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), RORouteDef_Complete::buildCurrentRoute(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), 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(), NBNodeCont::remapEdge(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeDummyEdges(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), 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(), and MSRouteProbe::writeXMLOutput().

SUMOReal RORouteDef_Alternatives::getThetaForCLogit ( ) const [private]

calculate the scaling factor in the logit model

Definition at line 217 of file RORouteDef_Alternatives.cpp.

References max, min, myAlternatives, PI, and SUMOReal.

Referenced by calculateLogitProbabilities().

void RORouteDef_Alternatives::invalidateLast ( )

Definition at line 312 of file RORouteDef_Alternatives.cpp.

References myLastUsed.

bool ReferencedItem::isSaved ( ) const throw () [inline, inherited]

Returns the information whether this item was already saved.

Returns:
Whether this item was saved

Definition at line 58 of file ReferencedItem.h.

References ReferencedItem::myWasSaved.

Referenced by RONet::computeRoute().

void ReferencedItem::markSaved ( ) throw () [inline, inherited]

Marks the item as saved.

Definition at line 65 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 318 of file RORouteDef_Alternatives.cpp.

References myAlternatives, and myLastUsed.

void Named::setID ( const std::string &  newID) [inline, inherited]

resets the id

Definition at line 65 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 327 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 116 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 125 of file RORouteDef_Alternatives.h.

Referenced by calculateLogitProbabilities().

const SUMOReal RORouteDef_Alternatives::myGawronA [private]

gawron a - value

Definition at line 119 of file RORouteDef_Alternatives.h.

Referenced by copy(), and gawronF().

Information whether all routes should be saved.

Definition at line 131 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 107 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 122 of file RORouteDef_Alternatives.h.

Referenced by addAlternative(), calculateLogitProbabilities(), and copy().

The maximum route number.

Definition at line 128 of file RORouteDef_Alternatives.h.

Referenced by copy().

Information whether a new route was generated.

Definition at line 104 of file RORouteDef_Alternatives.h.

Referenced by addAlternative(), and buildCurrentRoute().

Information whether new routes should be calculated.

Definition at line 134 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