SUMO - Simulation of Urban MObility
NIVissimEdge Class Reference

A temporary storage for edges imported from Vissim. More...

#include <NIVissimEdge.h>

Inheritance diagram for NIVissimEdge:
Inheritance graph
Collaboration diagram for NIVissimEdge:
Collaboration graph

Data Structures

class  connection_cluster_position_sorter
 
class  connection_position_sorter
 

Public Member Functions

void addDisturbance (int disturbance)
 
void addIncomingConnection (int id)
 Adds a connection where this edge is the destination. More...
 
void addOutgoingConnection (int id)
 Adds a connection where this edge is the source. More...
 
void addToConnectionCluster (NIVissimConnectionCluster *c)
 
bool addToTreatAsSame (NIVissimEdge *e)
 
void buildGeom ()
 
void checkDistrictConnectionExistanceAt (double pos)
 
bool crossesEdge (NIVissimAbstractEdge *c) const
 
Position crossesEdgeAtPoint (NIVissimAbstractEdge *c) const
 
Position getBegin2D () const
 
NIVissimEdgegetBestIncoming () const
 
NIVissimEdgegetBestOutgoing () const
 
NIVissimConnectiongetConnectionTo (NIVissimEdge *e)
 
const std::vector< int > & getDisturbances () const
 
Position getEnd2D () const
 Returns the end position of the edge. More...
 
const PositionVectorgetGeometry () const
 
Position getGeomPosition (double pos) const
 
int getID () const
 
double getLength () const
 Returns the length of the node. More...
 
NBNodegetNodeAt (const Position &p, NBNode *other=0)
 Returns the node at the given position As this may be ambigous, a second node not to return may be supplied. More...
 
const std::vector< NIVissimEdge * > & getToTreatAsSame () const
 
bool hasNodeCluster () const
 
void mergedInto (NIVissimConnectionCluster *old, NIVissimConnectionCluster *act)
 
 NIVissimEdge (int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
 Constructor. More...
 
bool overlapsWith (const AbstractPoly &p, double offset=0.0) const
 
void removeFromConnectionCluster (NIVissimConnectionCluster *c)
 
void setNodeCluster (int nodeid)
 
void setSpeed (int lane, int speedDist)
 
void splitAssigning ()
 
bool wasWithinAJunction () const
 Returns whether this edge was found to be within a junction. More...
 
 ~NIVissimEdge ()
 Destructor. More...
 

Static Public Member Functions

static void buildConnectionClusters ()
 Clusters connections of each edge. More...
 
static void clearDict ()
 
static void dict_buildNBEdges (NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec, double offset)
 Builds NBEdges from the VissimEdges within the dictionary. More...
 
static void dict_checkEdges2Join ()
 
static void dict_propagateSpeeds ()
 
static bool dictionary (int id, NIVissimAbstractEdge *e)
 
static bool dictionary (int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
 Adds the described item to the dictionary Builds the edge first. More...
 
static bool dictionary (int id, NIVissimEdge *o)
 Adds the edge to the dictionary. More...
 
static NIVissimEdgedictionary (int id)
 Returns the named edge from the dictionary. More...
 
static std::vector< int > getWithin (const AbstractPoly &p, double offset=0.0)
 
static void reportUnsetSpeeds ()
 Writes edges with unset speeds to the warnings message log instance. More...
 
static void splitAndAssignToNodes ()
 

Protected Attributes

std::vector< int > myDisturbances
 
PositionVector myGeom
 
int myID
 
int myNode
 

Private Types

typedef std::vector< NIVissimConnectionCluster * > ConnectionClusters
 The definition for a container for connection clusters. More...
 
typedef std::map< int, NIVissimEdge * > DictType
 Definition of the dictionary type. More...
 

Private Member Functions

void buildNBEdge (NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec, double sameNodesOffset)
 Builds the NBEdge from this VissimEdge. More...
 
void checkUnconnectedLaneSpeeds ()
 
std::pair< NIVissimConnectionCluster *, NBNode * > getFromNode (NBNodeCont &nc, ConnectionClusters &clusters)
 Returns the origin node. More...
 
std::vector< NIVissimConnection * > getOutgoingConnected (int lane) const
 
double getRealSpeed (int distNo)
 
std::pair< NIVissimConnectionCluster *, NBNode * > getToNode (NBNodeCont &nc, ConnectionClusters &clusters)
 Returns the destination node. More...
 
void propagateOwn ()
 
void propagateSpeed (double speed, std::vector< int > forLanes)
 
std::pair< NBNode *, NBNode * > remapOneOfNodes (NBNodeCont &nc, NIVissimDistrictConnection *d, NBNode *fromNode, NBNode *toNode)
 
std::pair< NBNode *, NBNode * > resolveSameNode (NBNodeCont &nc, double offset, NBNode *prevFrom, NBNode *prevTo)
 Tries to resolve the problem that the same node has been returned as origin and destination node. More...
 
void setDistrictSpeed ()
 

Static Private Member Functions

static NBNodegetNodeSecure (int nodeid, const Position &pos, const std::string &possibleName)
 

Private Attributes

bool myAmWithinJunction
 Information whether this edge was not build due to being within a junction. More...
 
NIVissimClosedLanesVector myClosedLanes
 List of lanes closed on this edge. More...
 
ConnectionClusters myConnectionClusters
 List of connection clusters along this edge. More...
 
std::vector< double > myDistrictConnections
 
std::vector< int > myIncomingConnections
 List of connections incoming to this edge. More...
 
std::vector< double > myLaneSpeeds
 
std::string myName
 The name of the edge. More...
 
int myNoLanes
 The number of lanes the edge has. More...
 
std::vector< int > myOutgoingConnections
 List of connections outgoing from this edge. More...
 
std::vector< int > myPatchedSpeeds
 
std::vector< NIVissimEdge * > myToTreatAsSame
 
std::string myType
 The type of the edge. More...
 
double myZuschlag1
 Additional load values for this edge. More...
 
double myZuschlag2
 

Static Private Attributes

static DictType myDict
 The dictionary. More...
 
static std::vector< std::string > myLanesWithMissingSpeeds
 
static int myMaxID = 0
 The current maximum id; needed for further id assignment. More...
 

Friends

class NIVissimNodeDef_Edges
 
class NIVissimNodeDef_Poly
 

Detailed Description

A temporary storage for edges imported from Vissim.

Definition at line 53 of file NIVissimEdge.h.

Member Typedef Documentation

◆ ConnectionClusters

The definition for a container for connection clusters.

Definition at line 162 of file NIVissimEdge.h.

◆ DictType

typedef std::map<int, NIVissimEdge*> NIVissimEdge::DictType
private

Definition of the dictionary type.

Definition at line 288 of file NIVissimEdge.h.

Constructor & Destructor Documentation

◆ NIVissimEdge()

NIVissimEdge::NIVissimEdge ( int  id,
const std::string &  name,
const std::string &  type,
int  noLanes,
double  zuschlag1,
double  zuschlag2,
double  length,
const PositionVector geom,
const NIVissimClosedLanesVector clv 
)

Constructor.

Definition at line 108 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myID, myLaneSpeeds, and myMaxID.

Referenced by dictionary().

◆ ~NIVissimEdge()

NIVissimEdge::~NIVissimEdge ( )

Destructor.

Definition at line 127 of file NIVissimEdge.cpp.

References myClosedLanes.

Member Function Documentation

◆ addDisturbance()

void NIVissimAbstractEdge::addDisturbance ( int  disturbance)
inherited

Definition at line 168 of file NIVissimAbstractEdge.cpp.

References NIVissimAbstractEdge::myDisturbances.

◆ addIncomingConnection()

void NIVissimEdge::addIncomingConnection ( int  id)

Adds a connection where this edge is the destination.

Definition at line 776 of file NIVissimEdge.cpp.

References myIncomingConnections.

◆ addOutgoingConnection()

void NIVissimEdge::addOutgoingConnection ( int  id)

Adds a connection where this edge is the source.

Definition at line 782 of file NIVissimEdge.cpp.

References myOutgoingConnections.

◆ addToConnectionCluster()

void NIVissimEdge::addToConnectionCluster ( NIVissimConnectionCluster c)

Definition at line 814 of file NIVissimEdge.cpp.

References myConnectionClusters.

Referenced by NIVissimConnectionCluster::recheckEdges().

◆ addToTreatAsSame()

bool NIVissimEdge::addToTreatAsSame ( NIVissimEdge e)

Definition at line 917 of file NIVissimEdge.cpp.

References myToTreatAsSame.

Referenced by dict_checkEdges2Join().

◆ buildConnectionClusters()

void NIVissimEdge::buildConnectionClusters ( )
static

Clusters connections of each edge.

For every edge stored in this container, its connections are collected and joined into "clusters" if they have the same "direction" (incoming/outgoing) and are not further than 10m away from each other.

Todo:
Probably the distance (MAX_CLUSTER_DISTANCE=10m) should be made variable

Definition at line 175 of file NIVissimEdge.cpp.

References NIVissimConnection::dictionary(), myConnectionClusters, myDict, myIncomingConnections, myOutgoingConnections, and VectorHelper< T >::removeDouble().

Referenced by NIImporter_Vissim::postLoadBuild().

◆ buildGeom()

void NIVissimEdge::buildGeom ( )
virtual

Implements NIVissimAbstractEdge.

Definition at line 772 of file NIVissimEdge.cpp.

◆ buildNBEdge()

void NIVissimEdge::buildNBEdge ( NBDistrictCont dc,
NBNodeCont nc,
NBEdgeCont ec,
double  sameNodesOffset 
)
private

Builds the NBEdge from this VissimEdge.

Parameters
[in]dcThe district container used if this edge must be split
[in]ncThe node container used for (optionally) building this edge's nodes
[in]ecThe edge control to add this edge to
[in]sameNodesOffsetOffset used to discriminate nodes
Exceptions
ProcessErrorIf one of the built nodes or edges could not be added to the according container

Definition at line 417 of file NIVissimEdge.cpp.

References OptionsCont::getFloat(), getFromNode(), Named::getID(), OptionsCont::getOptions(), NBNode::getPosition(), getToNode(), NBNodeCont::insert(), NBEdgeCont::insert(), LANESPREAD_CENTER, myAmWithinJunction, myConnectionClusters, myDistrictConnections, NIVissimAbstractEdge::myGeom, NIVissimAbstractEdge::myID, myLaneSpeeds, myLanesWithMissingSpeeds, myName, myNoLanes, myType, NODETYPE_NOJUNCTION, resolveSameNode(), NBEdgeCont::retrieve(), NBEdge::setSpeed(), NBEdgeCont::splitAt(), toString(), NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, and WRITE_WARNING.

Referenced by dict_buildNBEdges().

◆ checkDistrictConnectionExistanceAt()

void NIVissimEdge::checkDistrictConnectionExistanceAt ( double  pos)

Definition at line 842 of file NIVissimEdge.cpp.

References myDistrictConnections.

Referenced by NIVissimDistrictConnection::checkEdgeEnd().

◆ checkUnconnectedLaneSpeeds()

void NIVissimEdge::checkUnconnectedLaneSpeeds ( )
private

◆ clearDict()

void NIVissimAbstractEdge::clearDict ( )
staticinherited

◆ crossesEdge()

bool NIVissimAbstractEdge::crossesEdge ( NIVissimAbstractEdge c) const
inherited

◆ crossesEdgeAtPoint()

Position NIVissimAbstractEdge::crossesEdgeAtPoint ( NIVissimAbstractEdge c) const
inherited

◆ dict_buildNBEdges()

void NIVissimEdge::dict_buildNBEdges ( NBDistrictCont dc,
NBNodeCont nc,
NBEdgeCont ec,
double  offset 
)
static

Builds NBEdges from the VissimEdges within the dictionary.

Definition at line 238 of file NIVissimEdge.cpp.

References buildNBEdge(), and myDict.

Referenced by NIImporter_Vissim::postLoadBuild().

◆ dict_checkEdges2Join()

◆ dict_propagateSpeeds()

void NIVissimEdge::dict_propagateSpeeds ( )
static

◆ dictionary() [1/4]

◆ dictionary() [2/4]

◆ dictionary() [3/4]

bool NIVissimEdge::dictionary ( int  id,
NIVissimEdge o 
)
static

Adds the edge to the dictionary.

Definition at line 153 of file NIVissimEdge.cpp.

References myDict.

◆ dictionary() [4/4]

NIVissimEdge * NIVissimEdge::dictionary ( int  id)
static

Returns the named edge from the dictionary.

Definition at line 165 of file NIVissimEdge.cpp.

References myDict.

◆ getBegin2D()

Position NIVissimEdge::getBegin2D ( ) const

Returns the begin position of the edge

Definition at line 824 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myGeom.

◆ getBestIncoming()

NIVissimEdge * NIVissimEdge::getBestIncoming ( ) const

◆ getBestOutgoing()

NIVissimEdge * NIVissimEdge::getBestOutgoing ( ) const

◆ getConnectionTo()

◆ getDisturbances()

const std::vector< int > & NIVissimAbstractEdge::getDisturbances ( ) const
inherited

◆ getEnd2D()

Position NIVissimEdge::getEnd2D ( ) const

Returns the end position of the edge.

Definition at line 830 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myGeom.

◆ getFromNode()

◆ getGeometry()

◆ getGeomPosition()

Position NIVissimAbstractEdge::getGeomPosition ( double  pos) const
inherited

◆ getID()

◆ getLength()

double NIVissimEdge::getLength ( ) const

Returns the length of the node.

Definition at line 836 of file NIVissimEdge.cpp.

References PositionVector::length(), and NIVissimAbstractEdge::myGeom.

Referenced by setDistrictSpeed().

◆ getNodeAt()

NBNode* NIVissimEdge::getNodeAt ( const Position p,
NBNode other = 0 
)

Returns the node at the given position As this may be ambigous, a second node not to return may be supplied.

◆ getNodeSecure()

static NBNode* NIVissimEdge::getNodeSecure ( int  nodeid,
const Position pos,
const std::string &  possibleName 
)
staticprivate

◆ getOutgoingConnected()

◆ getRealSpeed()

double NIVissimEdge::getRealSpeed ( int  distNo)
private

Definition at line 520 of file NIVissimEdge.cpp.

References DistributionCont::dictionary(), and WRITE_WARNING.

Referenced by propagateSpeed().

◆ getToNode()

std::pair< NIVissimConnectionCluster *, NBNode * > NIVissimEdge::getToNode ( NBNodeCont nc,
ConnectionClusters clusters 
)
private

◆ getToTreatAsSame()

const std::vector< NIVissimEdge * > & NIVissimEdge::getToTreatAsSame ( ) const

Definition at line 965 of file NIVissimEdge.cpp.

References myToTreatAsSame.

Referenced by NIVissimConnectionCluster::extendByToTreatAsSame().

◆ getWithin()

std::vector< int > NIVissimAbstractEdge::getWithin ( const AbstractPoly p,
double  offset = 0.0 
)
staticinherited

◆ hasNodeCluster()

bool NIVissimAbstractEdge::hasNodeCluster ( ) const
inherited

Definition at line 142 of file NIVissimAbstractEdge.cpp.

References NIVissimAbstractEdge::myNode.

◆ mergedInto()

void NIVissimEdge::mergedInto ( NIVissimConnectionCluster old,
NIVissimConnectionCluster act 
)

Definition at line 789 of file NIVissimEdge.cpp.

References myConnectionClusters.

◆ overlapsWith()

bool NIVissimAbstractEdge::overlapsWith ( const AbstractPoly p,
double  offset = 0.0 
) const
inherited

◆ propagateOwn()

void NIVissimEdge::propagateOwn ( )
private

◆ propagateSpeed()

◆ remapOneOfNodes()

◆ removeFromConnectionCluster()

void NIVissimEdge::removeFromConnectionCluster ( NIVissimConnectionCluster c)

Definition at line 805 of file NIVissimEdge.cpp.

References myConnectionClusters.

Referenced by NIVissimConnectionCluster::recheckEdges().

◆ reportUnsetSpeeds()

void NIVissimEdge::reportUnsetSpeeds ( )
static

Writes edges with unset speeds to the warnings message log instance.

Vissim has no direct speed definition of edges; still, we try to propagate speed changes along the streets. If a lane is not covered by such, its id is put into the static container "myLanesWithMissingSpeeds". If the option "vissim.report-unset-speeds" is set, all lane ids stored within this container are written.

Definition at line 971 of file NIVissimEdge.cpp.

References myLanesWithMissingSpeeds, and WRITE_WARNING.

Referenced by NIImporter_Vissim::postLoadBuild().

◆ resolveSameNode()

std::pair< NBNode *, NBNode * > NIVissimEdge::resolveSameNode ( NBNodeCont nc,
double  offset,
NBNode prevFrom,
NBNode prevTo 
)
private

◆ setDistrictSpeed()

◆ setNodeCluster()

void NIVissimEdge::setNodeCluster ( int  nodeid)
virtual

Implements NIVissimAbstractEdge.

Definition at line 766 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myNode.

◆ setSpeed()

void NIVissimEdge::setSpeed ( int  lane,
int  speedDist 
)

◆ splitAndAssignToNodes()

void NIVissimAbstractEdge::splitAndAssignToNodes ( )
staticinherited

◆ splitAssigning()

void NIVissimAbstractEdge::splitAssigning ( )
inherited

◆ wasWithinAJunction()

bool NIVissimEdge::wasWithinAJunction ( ) const
inline

Returns whether this edge was found to be within a junction.

Returns
Whether this node is assumed to be within a junction

Definition at line 105 of file NIVissimEdge.h.

References getBestIncoming(), getBestOutgoing(), and myAmWithinJunction.

Referenced by NIVissimConnection::buildEdgeConnections().

Friends And Related Function Documentation

◆ NIVissimNodeDef_Edges

friend class NIVissimNodeDef_Edges
friend

Definition at line 112 of file NIVissimEdge.h.

◆ NIVissimNodeDef_Poly

friend class NIVissimNodeDef_Poly
friend

Definition at line 113 of file NIVissimEdge.h.

Field Documentation

◆ myAmWithinJunction

bool NIVissimEdge::myAmWithinJunction
private

Information whether this edge was not build due to being within a junction.

Definition at line 284 of file NIVissimEdge.h.

Referenced by buildNBEdge(), and wasWithinAJunction().

◆ myClosedLanes

NIVissimClosedLanesVector NIVissimEdge::myClosedLanes
private

List of lanes closed on this edge.

Definition at line 264 of file NIVissimEdge.h.

Referenced by ~NIVissimEdge().

◆ myConnectionClusters

ConnectionClusters NIVissimEdge::myConnectionClusters
private

List of connection clusters along this edge.

Definition at line 267 of file NIVissimEdge.h.

Referenced by addToConnectionCluster(), buildConnectionClusters(), buildNBEdge(), mergedInto(), removeFromConnectionCluster(), and resolveSameNode().

◆ myDict

NIVissimEdge::DictType NIVissimEdge::myDict
staticprivate

◆ myDistrictConnections

std::vector<double> NIVissimEdge::myDistrictConnections
private

◆ myDisturbances

std::vector<int> NIVissimAbstractEdge::myDisturbances
protectedinherited

◆ myGeom

◆ myID

int NIVissimAbstractEdge::myID
protectedinherited

◆ myIncomingConnections

std::vector<int> NIVissimEdge::myIncomingConnections
private

List of connections incoming to this edge.

Definition at line 270 of file NIVissimEdge.h.

Referenced by addIncomingConnection(), buildConnectionClusters(), getBestIncoming(), and getConnectionTo().

◆ myLaneSpeeds

std::vector<double> NIVissimEdge::myLaneSpeeds
private

◆ myLanesWithMissingSpeeds

std::vector< std::string > NIVissimEdge::myLanesWithMissingSpeeds
staticprivate

Definition at line 296 of file NIVissimEdge.h.

Referenced by buildNBEdge(), and reportUnsetSpeeds().

◆ myMaxID

int NIVissimEdge::myMaxID = 0
staticprivate

The current maximum id; needed for further id assignment.

Definition at line 294 of file NIVissimEdge.h.

Referenced by NIVissimEdge().

◆ myName

std::string NIVissimEdge::myName
private

The name of the edge.

Definition at line 252 of file NIVissimEdge.h.

Referenced by buildNBEdge().

◆ myNode

int NIVissimAbstractEdge::myNode
protectedinherited

◆ myNoLanes

int NIVissimEdge::myNoLanes
private

The number of lanes the edge has.

Definition at line 258 of file NIVissimEdge.h.

Referenced by buildNBEdge(), propagateSpeed(), and setDistrictSpeed().

◆ myOutgoingConnections

std::vector<int> NIVissimEdge::myOutgoingConnections
private

List of connections outgoing from this edge.

Definition at line 273 of file NIVissimEdge.h.

Referenced by addOutgoingConnection(), buildConnectionClusters(), getBestOutgoing(), getConnectionTo(), and getOutgoingConnected().

◆ myPatchedSpeeds

std::vector<int> NIVissimEdge::myPatchedSpeeds
private

Definition at line 277 of file NIVissimEdge.h.

Referenced by propagateSpeed(), and setSpeed().

◆ myToTreatAsSame

std::vector<NIVissimEdge*> NIVissimEdge::myToTreatAsSame
private

Definition at line 281 of file NIVissimEdge.h.

Referenced by addToTreatAsSame(), and getToTreatAsSame().

◆ myType

std::string NIVissimEdge::myType
private

The type of the edge.

Definition at line 255 of file NIVissimEdge.h.

Referenced by buildNBEdge().

◆ myZuschlag1

double NIVissimEdge::myZuschlag1
private

Additional load values for this edge.

Definition at line 261 of file NIVissimEdge.h.

◆ myZuschlag2

double NIVissimEdge::myZuschlag2
private

Definition at line 261 of file NIVissimEdge.h.


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