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

A netgen-representation of a node. More...

#include <NGNode.h>

Inheritance diagram for NGNode:
Named

Public Member Functions

void addLink (NGEdge *link)
 Adds the given link to the internal list. More...
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
NBNodebuildNBNode (NBNetBuilder &nb) const
 Builds and returns this node's netbuild-representation. More...
 
bool connected (NGNode *node) const
 Returns whether the other node is connected. More...
 
const std::string & getID () const
 Returns the id. More...
 
SUMOReal getMaxNeighbours ()
 Returns this node's maximum neighbour number. More...
 
const PositiongetPosition () const
 Returns this node's position. More...
 
 NGNode (const std::string &id)
 Constructor. More...
 
 NGNode (const std::string &id, int xPos, int yPos)
 Constructor. More...
 
 NGNode (const std::string &id, int xID, int yID, bool amCenter)
 Constructor. More...
 
void removeLink (NGEdge *link)
 Removes the given link. More...
 
bool samePos (int xPos, int yPos) const
 Returns whether the node has the given position. More...
 
void setID (const std::string &newID)
 resets the id More...
 
void setMaxNeighbours (SUMOReal value)
 Sets this node's maximum neighbour number. More...
 
void setX (SUMOReal x)
 Sets a new value for x-position. More...
 
void setY (SUMOReal y)
 Sets a new value for y-position. More...
 
 ~NGNode ()
 Destructor. More...
 

Protected Attributes

std::string myID
 The name of the object. More...
 

Private Attributes

NGEdgeList LinkList
 List of connected links. More...
 
bool myAmCenter
 Information whether this is the center of a cpider-net. More...
 
SUMOReal myMaxNeighbours
 The maximum number of neighbours. More...
 
Position myPosition
 The position of the node. More...
 
int xID
 Integer x-position (x-id) More...
 
int yID
 Integer y-position (y-id) More...
 

Friends

class NGRandomNetBuilder
 

Detailed Description

A netgen-representation of a node.

Definition at line 58 of file NGNode.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
[in]idThe id of the node

Definition at line 57 of file NGNode.cpp.

NGNode::NGNode ( const std::string &  id,
int  xPos,
int  yPos 
)

Constructor.

Parameters
[in]idThe id of the node
[in]xPosThe x-position of the node
[in]yPosThe y-position of the node

Definition at line 61 of file NGNode.cpp.

NGNode::NGNode ( const std::string &  id,
int  xID,
int  yID,
bool  amCenter 
)

Constructor.

Parameters
[in]idThe id of the node
[in]xPosThe x-position of the node
[in]yPosThe y-position of the node
[in]amCenterInformation whether this is the center-node of a spider-net

Definition at line 65 of file NGNode.cpp.

NGNode::~NGNode ( )

Destructor.

Definition at line 69 of file NGNode.cpp.

References LinkList.

Member Function Documentation

void NGNode::addLink ( NGEdge link)

Adds the given link to the internal list.

Parameters
[in]linkThe link to add

Definition at line 115 of file NGNode.cpp.

References LinkList.

Referenced by NGEdge::NGEdge().

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 121 of file Named.h.

References Named::StoringVisitor::add().

NBNode * NGNode::buildNBNode ( NBNetBuilder nb) const

Builds and returns this node's netbuild-representation.

The position of the node is transformed to cartesian using GeoConvHelper::x2cartesian, first. If this node is the center node of a spider net, a node of the type NBNode::NODETYPE_NOJUNCTION is returned. Otherwise, a plain node is built and it is checked whether the options indicate building one of the tls node-types. In this case, a logic is built and stored. A ProcessError is thrown if this fails (should never happen, in fact).

Parameters
[in]nbThe netbuilder to retrieve the tls-container from
Returns
The built node
Exceptions
ProcessErrorIf the built tls logic could not be added (should never happen)
Todo:

There is no interaction with explicit node setting options? Where is this done?

Check whether throwing an exception is really necessary, here

Definition at line 79 of file NGNode.cpp.

References StringBijection< T >::get(), OptionsCont::getOptions(), GeoConvHelper::getProcessing(), OptionsCont::getString(), NBNetBuilder::getTLLogicCont(), NBTrafficLightLogicCont::insert(), OptionsCont::isSet(), myAmCenter, Named::myID, myPosition, NODETYPE_NOJUNCTION, NODETYPE_PRIORITY, NODETYPE_TRAFFIC_LIGHT, NODETYPE_TRAFFIC_LIGHT_NOJUNCTION, SUMOXMLDefinitions::NodeTypes, SUMOXMLDefinitions::TrafficLightTypes, and GeoConvHelper::x2cartesian().

bool NGNode::connected ( NGNode node) const

Returns whether the other node is connected.

Parameters
[in]nodeThe link to check whether it is connected
Returns
Whether the given node is connected

Definition at line 127 of file NGNode.cpp.

References LinkList.

Referenced by NGRandomNetBuilder::findPossibleOuterNodes().

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

Returns the id.

Returns
The stored 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(), NBDistrict::addSink(), NBDistrict::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().

SUMOReal NGNode::getMaxNeighbours ( )
inline

Returns this node's maximum neighbour number.

Returns
The maximum neighbour number of the node

Definition at line 103 of file NGNode.h.

References myMaxNeighbours.

Referenced by NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGRandomNetBuilder::findPossibleOuterNodes().

const Position& NGNode::getPosition ( ) const
inline

Returns this node's position.

Returns
The position of the node

Definition at line 94 of file NGNode.h.

References myPosition.

Referenced by NGRandomNetBuilder::canConnect(), NGRandomNetBuilder::checkAngles(), and NGRandomNetBuilder::createNewNode().

void NGNode::removeLink ( NGEdge link)

Removes the given link.

The given pointer is compared to those in the list. A matching pointer is removed, not other same connections.

Parameters
[in]linkThe link to remove

Definition at line 121 of file NGNode.cpp.

References LinkList.

Referenced by NGEdge::~NGEdge().

bool NGNode::samePos ( int  xPos,
int  yPos 
) const
inline

Returns whether the node has the given position.

Parameters
[in]nodeThe link to check whether it is connected
Returns
Whether the given node is connected

Definition at line 183 of file NGNode.h.

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

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

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

void NGNode::setMaxNeighbours ( SUMOReal  value)
inline

Sets this node's maximum neighbour number.

Parameters
[in]valueThe new maximum neighbour number of the node

Definition at line 112 of file NGNode.h.

References myMaxNeighbours.

Referenced by NGRandomNetBuilder::createNet(), and NGRandomNetBuilder::createNewNode().

void NGNode::setX ( SUMOReal  x)
inline

Sets a new value for x-position.

Parameters
[in]valueThe new x-position of this node

Definition at line 121 of file NGNode.h.

References myPosition, Position::set(), and Position::y().

Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().

void NGNode::setY ( SUMOReal  y)
inline

Sets a new value for y-position.

Parameters
[in]valueThe new y-position of this node

Definition at line 130 of file NGNode.h.

References myPosition, Position::set(), and Position::x().

Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().

Friends And Related Function Documentation

friend class NGRandomNetBuilder
friend

Definition at line 188 of file NGNode.h.

Field Documentation

bool NGNode::myAmCenter
private

Information whether this is the center of a cpider-net.

Definition at line 207 of file NGNode.h.

Referenced by buildNBNode().

SUMOReal NGNode::myMaxNeighbours
private

The maximum number of neighbours.

Definition at line 204 of file NGNode.h.

Referenced by getMaxNeighbours(), and setMaxNeighbours().

Position NGNode::myPosition
private

The position of the node.

Definition at line 201 of file NGNode.h.

Referenced by buildNBNode(), getPosition(), setX(), and setY().

int NGNode::xID
private

Integer x-position (x-id)

Definition at line 192 of file NGNode.h.

int NGNode::yID
private

Integer y-position (y-id)

Definition at line 195 of file NGNode.h.


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