SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODDistrict Class Reference

A district (origin/destination) More...

#include <ODDistrict.h>

Inheritance diagram for ODDistrict:
Named

Public Member Functions

void addSink (const std::string &id, SUMOReal weight)
 Adds a sink connection.
void addSource (const std::string &id, SUMOReal weight)
 Adds a source connection.
const std::string & getID () const
 Returns the id.
std::string getRandomSink () const throw (OutOfBoundsException)
 Returns the id of a sink to use.
std::string getRandomSource () const throw (OutOfBoundsException)
 Returns the id of a source to use.
 ODDistrict (const std::string &id)
 Constructor.
void setID (const std::string &newID)
 resets the id
unsigned int sinkNumber () const
 Returns the number of sinks.
unsigned int sourceNumber () const
 Returns the number of sources.
 ~ODDistrict ()
 Destructor.

Protected Attributes

std::string myID
 The name of the object.

Private Member Functions

 ODDistrict (const ODDistrict &s)
 invalidated copy constructor
ODDistrictoperator= (const ODDistrict &s)
 invalidated assignment operator

Private Attributes

RandomDistributor< std::string > mySinks
 Container of weighted sinks.
RandomDistributor< std::string > mySources
 Container of weighted sources.

Detailed Description

A district (origin/destination)

Class representing a district which has some ingoing and outgoing connections to the road network which may be weighted.

Definition at line 51 of file ODDistrict.h.


Constructor & Destructor Documentation

ODDistrict::ODDistrict ( const std::string &  id)

Constructor.

Parameters:
[in]idThe id of the district

Definition at line 48 of file ODDistrict.cpp.

ODDistrict::~ODDistrict ( )

Destructor.

Definition at line 52 of file ODDistrict.cpp.

ODDistrict::ODDistrict ( const ODDistrict s)
private

invalidated copy constructor


Member Function Documentation

void ODDistrict::addSink ( const std::string &  id,
SUMOReal  weight 
)

Adds a sink connection.

A sink connection is an edge which is used by vehicles to leave the network and reach the district. The weight is used when a random sink shall be chosen.

BTW, it is possible to add a sink twice. In this case it will occure twice within the distribution so that the behaviour is as adding both given probabilities.

Parameters:
[in]idThe id of the sink
[in]weightThe weight (probability to be chosen) of the sink

Definition at line 62 of file ODDistrict.cpp.

References RandomDistributor< T >::add(), and mySinks.

Referenced by ODDistrictHandler::addSink().

void ODDistrict::addSource ( const std::string &  id,
SUMOReal  weight 
)

Adds a source connection.

A source is an edge where vehicles leave the district from to reach the network. The weight is used when a random source shall be chosen.

BTW, it is possible to add a source twice. In this case it will occure twice within the distribution so that the behaviour is as adding both given probabilities.

Parameters:
[in]idThe id of the source
[in]weightThe weight (probability to be chosen) of the source

Definition at line 56 of file ODDistrict.cpp.

References RandomDistributor< T >::add(), and mySources.

Referenced by ODDistrictHandler::addSource().

const std::string& Named::getID ( ) const
inlineinherited

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 MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::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().

std::string ODDistrict::getRandomSink ( ) const throw (OutOfBoundsException)

Returns the id of a sink to use.

If the list of this district's sinks is empty, an OutOfBoundsException -exception is thrown.

Returns:
One of this district's sinks chosen randomly regarding their weights
Exceptions:
OutOfBoundsExceptionIf this district has no sinks

Definition at line 74 of file ODDistrict.cpp.

References RandomDistributor< T >::get(), and mySinks.

Referenced by ODDistrictCont::getRandomSinkFromDistrict().

std::string ODDistrict::getRandomSource ( ) const throw (OutOfBoundsException)

Returns the id of a source to use.

If the list of this district's sources is empty, an OutOfBoundsException -exception is thrown.

Returns:
One of this district's sources chosen randomly regarding their weights
Exceptions:
OutOfBoundsExceptionIf this district has no sources

Definition at line 68 of file ODDistrict.cpp.

References RandomDistributor< T >::get(), and mySources.

Referenced by ODDistrictCont::getRandomSourceFromDistrict().

ODDistrict& ODDistrict::operator= ( const ODDistrict s)
private

invalidated assignment operator

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

unsigned int ODDistrict::sinkNumber ( ) const

Returns the number of sinks.

Returns:
The number of known sinks

Definition at line 80 of file ODDistrict.cpp.

References RandomDistributor< T >::getVals(), and mySinks.

Referenced by ODMatrix::add().

unsigned int ODDistrict::sourceNumber ( ) const

Returns the number of sources.

Returns:
The number of known sources

Definition at line 86 of file ODDistrict.cpp.

References RandomDistributor< T >::getVals(), and mySources.

Referenced by ODMatrix::add().


Field Documentation

RandomDistributor<std::string> ODDistrict::mySinks
private

Container of weighted sinks.

Definition at line 137 of file ODDistrict.h.

Referenced by addSink(), getRandomSink(), and sinkNumber().

RandomDistributor<std::string> ODDistrict::mySources
private

Container of weighted sources.

Definition at line 134 of file ODDistrict.h.

Referenced by addSource(), getRandomSource(), and sourceNumber().


The documentation for this class was generated from the following files: