SUMO - Simulation of Urban MObility
|
A class representing a single district. More...
#include <NBDistrict.h>
Public Member Functions | |
void | addShape (const PositionVector &p) |
Sets the shape of this district. More... | |
bool | addSink (NBEdge *const sink, SUMOReal weight) |
Adds a sink. More... | |
bool | addSource (NBEdge *const source, SUMOReal weight) |
Adds a source. More... | |
void | addTo (const StoringVisitor &cont) const |
Adds this object to the given container. More... | |
const std::string & | getID () const |
Returns the id. More... | |
const Position & | getPosition () const |
Returns the position of this district's center. More... | |
const PositionVector & | getShape () const |
Returns the shape. More... | |
const std::vector< NBEdge * > & | getSinkEdges () const |
Returns the sinks. More... | |
const std::vector< SUMOReal > & | getSinkWeights () const |
Returns the weights of the sinks. More... | |
const std::vector< NBEdge * > & | getSourceEdges () const |
Returns the sources. More... | |
const std::vector< SUMOReal > & | getSourceWeights () const |
Returns the weights of the sources. More... | |
NBDistrict (const std::string &id, const Position &pos) | |
Constructor with id, and position. More... | |
NBDistrict (const std::string &id) | |
Constructor without position. More... | |
void | removeFromSinksAndSources (NBEdge *const e) |
Removes the given edge from the lists of sources and sinks. More... | |
void | replaceIncoming (const EdgeVector &which, NBEdge *const by) |
Replaces incoming edges from the vector (sinks) by the given edge. More... | |
void | replaceOutgoing (const EdgeVector &which, NBEdge *const by) |
Replaces outgoing edges from the vector (source) by the given edge. More... | |
void | setCenter (const Position &pos) |
Sets the center coordinates. More... | |
void | setID (const std::string &newID) |
resets the id More... | |
~NBDistrict () | |
Destructor. More... | |
Applying offset | |
void | reshiftPosition (SUMOReal xoff, SUMOReal yoff) |
Applies an offset to the district. More... | |
Protected Attributes | |
std::string | myID |
The name of the object. More... | |
Private Types | |
typedef std::vector< SUMOReal > | WeightsCont |
Definition of a vector of connection weights. More... | |
Private Member Functions | |
NBDistrict (const NBDistrict &s) | |
NBDistrict & | operator= (const NBDistrict &s) |
Private Attributes | |
Position | myPosition |
The position of the district. More... | |
PositionVector | myShape |
The shape of the dsitrict. More... | |
EdgeVector | mySinks |
The sinks (connection from network to district) More... | |
WeightsCont | mySinkWeights |
The weights of the sinks. More... | |
EdgeVector | mySources |
The sources (connection from district to network) More... | |
WeightsCont | mySourceWeights |
The weights of the sources. More... | |
A class representing a single district.
A "district" is an area within the network which may be referenced by O/D-matrices. It stems from importing VISUM-networks. Work with VISUM- -networks also made it necessary that a district knows the edges at which new vehicles shall approach the simulated network (sources) and those to use when leaving the network (sinks). These connections to the network are weighted.
Later work on VISUM required also parsing the shape of a district. This information is used by some external tools only, it is even not shown within the GUI.
Definition at line 72 of file NBDistrict.h.
|
private |
Definition of a vector of connection weights.
Definition at line 244 of file NBDistrict.h.
NBDistrict::NBDistrict | ( | const std::string & | id, |
const Position & | pos | ||
) |
Constructor with id, and position.
[in] | id | The id of the district |
[in] | pos | The position of the district |
Definition at line 53 of file NBDistrict.cpp.
NBDistrict::NBDistrict | ( | const std::string & | id | ) |
Constructor without position.
The position must be computed later
[in] | id | The id of the district |
Definition at line 58 of file NBDistrict.cpp.
NBDistrict::~NBDistrict | ( | ) |
Destructor.
Definition at line 62 of file NBDistrict.cpp.
|
private |
invalid copy constructor
void NBDistrict::addShape | ( | const PositionVector & | p | ) |
Sets the shape of this district.
[in] | p | The new shape |
Definition at line 188 of file NBDistrict.cpp.
References myShape.
Adds a sink.
It is checked whether the edge has already been added as a sink. false is returned in this case. Otherwise, the sink is pushed into the list of sink and the weight into the list of sink weights. both lists stay sorted this way. true is returned.
[in] | sink | An edge that shall be used as sink |
[in] | weight | The weight of the sink |
Definition at line 87 of file NBDistrict.cpp.
References Named::getID(), mySinks, and mySinkWeights.
Referenced by NBDistrictCont::addSink(), and NIVissimDistrictConnection::dict_BuildDistricts().
Adds a source.
It is checked whether the edge has already been added as a source. false is returned in this case. Otherwise, the source is pushed into the list of sources and the weight into the list of source weights. both lists stay sorted this way. true is returned.
[in] | source | An edge that shall be used as source |
[in] | weight | The weight of the source |
Definition at line 74 of file NBDistrict.cpp.
References Named::getID(), mySources, and mySourceWeights.
Referenced by NBDistrictCont::addSource(), and NIVissimDistrictConnection::dict_BuildDistricts().
|
inlineinherited |
Adds this object to the given container.
in,filled] | cont The container to add this item to |
Definition at line 121 of file Named.h.
References Named::StoringVisitor::add().
|
inlineinherited |
Returns the id.
Definition at line 60 of file Named.h.
References Named::myID.
Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), addSink(), addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NBNode::buildCrossings(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), NBNode::buildInnerEdges(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), GUINet::createTLWrapper(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSPModel_Striping::MovePedestrians::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPModel_Striping::getNextLane(), GUIVehicle::getParameterWindow(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSTrafficLightLogic::init(), PedestrianEdge< E, L, N >::initPedestrianNetwork(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), GUIViewTraffic::onGamingClick(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), MSEdge::by_id_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(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_JE2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSRightOfWayJunction::postloadInit(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), MSLink::setRequestInformation(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSLCM_JE2013::wantsChange(), MSFCDExport::write(), MSEmissionExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_SUMO::writeRoundabout(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_DlrNavteq::writeTrafficSignals(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
|
inline |
Returns the position of this district's center.
Definition at line 130 of file NBDistrict.h.
References myPosition.
Referenced by NIImporter_VISUM::buildDistrictNode().
|
inline |
Returns the shape.
Definition at line 222 of file NBDistrict.h.
References myShape.
Referenced by NWWriter_SUMO::writeDistrict().
|
inline |
Returns the sinks.
Definition at line 214 of file NBDistrict.h.
References mySinks.
Referenced by NWWriter_SUMO::writeDistrict().
|
inline |
Returns the weights of the sinks.
Definition at line 206 of file NBDistrict.h.
References mySinkWeights.
Referenced by NWWriter_SUMO::writeDistrict().
|
inline |
Returns the sources.
Definition at line 198 of file NBDistrict.h.
References mySources.
Referenced by NWWriter_SUMO::writeDistrict().
|
inline |
Returns the weights of the sources.
Definition at line 190 of file NBDistrict.h.
References mySourceWeights.
Referenced by NWWriter_SUMO::writeDistrict().
|
private |
invalid assignment operator
void NBDistrict::removeFromSinksAndSources | ( | NBEdge *const | e | ) |
Removes the given edge from the lists of sources and sinks.
The according weights are removed, too.
[in] | e | The edge to remove from sinks/sources |
Definition at line 170 of file NBDistrict.cpp.
References mySinks, mySinkWeights, mySources, and mySourceWeights.
void NBDistrict::replaceIncoming | ( | const EdgeVector & | which, |
NBEdge *const | by | ||
) |
Replaces incoming edges from the vector (sinks) by the given edge.
When an edge is split/joined/removed/etc., it may get necessary to replace prior edges by new ones. This method replaces all occurences of the edges from "which" within incoming edges (sinks) by the given edge.
The new sink edge's weight is the sum of the weights of the replaced edges.
[in] | which | List of edges to replace |
[in] | by | The replacement |
Definition at line 106 of file NBDistrict.cpp.
References mySinks, mySinkWeights, and SUMOReal.
Referenced by NBNode::replaceIncoming().
void NBDistrict::replaceOutgoing | ( | const EdgeVector & | which, |
NBEdge *const | by | ||
) |
Replaces outgoing edges from the vector (source) by the given edge.
When an edge is split/joined/removed/etc., it may get necessary to replace prior edges by new ones. This method replaces all occurences of the edges from "which" within outgoing edges (sources) by the given edge.
The new source edge's weight is the sum of the weights of the replaced edges.
[in] | which | List of edges to replace |
[in] | by | The replacement |
Definition at line 138 of file NBDistrict.cpp.
References mySources, mySourceWeights, and SUMOReal.
Referenced by NBNode::replaceOutgoing().
Applies an offset to the district.
[in] | xoff | The x-offset to apply |
[in] | yoff | The y-offset to apply |
Definition at line 67 of file NBDistrict.cpp.
References myPosition, myShape, Position::reshiftRotate(), and PositionVector::reshiftRotate().
void NBDistrict::setCenter | ( | const Position & | pos | ) |
Sets the center coordinates.
[in] | pos | The new center to assign |
Definition at line 100 of file NBDistrict.cpp.
References myPosition.
|
inlineinherited |
resets the id
[in] | newID | The new id of this object |
Definition at line 68 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
protectedinherited |
The name of the object.
Definition at line 128 of file Named.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), RODFDetector::buildDestinationDistribution(), NGEdge::buildNBEdge(), NGNode::buildNBNode(), NBNode::computeNodeShape(), MSCalibrator::execute(), Named::getID(), NBEdge::getLaneID(), NBEdge::getLaneIDInsecure(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSCalibrator::init(), NBEdge::init(), MSCalibrator::myStartElement(), MSCalibrator::VehicleRemover::notifyEnter(), MSMeanData::openInterval(), RORouteDef::preComputeCurrentRoute(), NBEdge::reinitNodes(), MSRoute::release(), RORouteDef::repairCurrentRoute(), Named::setID(), NBEdge::splitGeometry(), RODFDetector::writeEmitterDefinition(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), RODFDetector::writeSingleSpeedTrigger(), MSCalibrator::writeXMLOutput(), and MSE3Collector::writeXMLOutput().
|
private |
The position of the district.
Definition at line 259 of file NBDistrict.h.
Referenced by getPosition(), reshiftPosition(), and setCenter().
|
private |
The shape of the dsitrict.
Definition at line 262 of file NBDistrict.h.
Referenced by addShape(), getShape(), and reshiftPosition().
|
private |
The sinks (connection from network to district)
Definition at line 253 of file NBDistrict.h.
Referenced by addSink(), getSinkEdges(), removeFromSinksAndSources(), and replaceIncoming().
|
private |
The weights of the sinks.
Definition at line 256 of file NBDistrict.h.
Referenced by addSink(), getSinkWeights(), removeFromSinksAndSources(), and replaceIncoming().
|
private |
The sources (connection from district to network)
Definition at line 247 of file NBDistrict.h.
Referenced by addSource(), getSourceEdges(), removeFromSinksAndSources(), and replaceOutgoing().
|
private |
The weights of the sources.
Definition at line 250 of file NBDistrict.h.
Referenced by addSource(), getSourceWeights(), removeFromSinksAndSources(), and replaceOutgoing().