SUMO - Simulation of Urban MObility
NIVissimEdge Class Reference

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

#include <NIVissimEdge.h>

Inheritance diagram for NIVissimEdge:
NIVissimAbstractEdge

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 (SUMOReal pos)
 
SUMOReal crossesAtPoint (const Position &p1, const Position &p2) const
 
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 (SUMOReal pos) const
 
int getID () const
 
SUMOReal 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, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
 Constructor. More...
 
bool overlapsWith (const AbstractPoly &p, SUMOReal offset=0.0) const
 
void removeFromConnectionCluster (NIVissimConnectionCluster *c)
 
void setNodeCluster (int nodeid)
 
void setSpeed (size_t 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, SUMOReal 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, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal 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, SUMOReal 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, SUMOReal 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
 
SUMOReal getRealSpeed (int distNo)
 
std::pair< NIVissimConnectionCluster *, NBNode * > getToNode (NBNodeCont &nc, ConnectionClusters &clusters)
 Returns the destination node. More...
 
void propagateOwn ()
 
void propagateSpeed (SUMOReal 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, SUMOReal 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< SUMORealmyDistrictConnections
 
std::vector< int > myIncomingConnections
 List of connections incoming to this edge. More...
 
std::vector< SUMORealmyLaneSpeeds
 
std::string myName
 The name of the edge. More...
 
unsigned 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 tape of the edge. More...
 
SUMOReal myZuschlag1
 Additional load values for this edge. More...
 
SUMOReal 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 61 of file NIVissimEdge.h.

Member Typedef Documentation

The definition for a container for connection clusters.

Definition at line 170 of file NIVissimEdge.h.

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

Definition of the dictionary type.

Definition at line 296 of file NIVissimEdge.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 120 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myID, myLaneSpeeds, and myMaxID.

Referenced by dictionary().

NIVissimEdge::~NIVissimEdge ( )

Destructor.

Definition at line 139 of file NIVissimEdge.cpp.

References myClosedLanes.

Member Function Documentation

void NIVissimAbstractEdge::addDisturbance ( int  disturbance)
inherited

Definition at line 194 of file NIVissimAbstractEdge.cpp.

References NIVissimAbstractEdge::myDisturbances.

void NIVissimEdge::addIncomingConnection ( int  id)

Adds a connection where this edge is the destination.

Definition at line 788 of file NIVissimEdge.cpp.

References myIncomingConnections.

void NIVissimEdge::addOutgoingConnection ( int  id)

Adds a connection where this edge is the source.

Definition at line 794 of file NIVissimEdge.cpp.

References myOutgoingConnections.

void NIVissimEdge::addToConnectionCluster ( NIVissimConnectionCluster c)

Definition at line 826 of file NIVissimEdge.cpp.

References myConnectionClusters.

Referenced by NIVissimConnectionCluster::recheckEdges().

bool NIVissimEdge::addToTreatAsSame ( NIVissimEdge e)

Definition at line 932 of file NIVissimEdge.cpp.

References myToTreatAsSame.

Referenced by dict_checkEdges2Join().

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 187 of file NIVissimEdge.cpp.

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

Referenced by NIImporter_Vissim::postLoadBuild().

void NIVissimEdge::buildGeom ( )
virtual

Implements NIVissimAbstractEdge.

Definition at line 784 of file NIVissimEdge.cpp.

void NIVissimEdge::buildNBEdge ( NBDistrictCont dc,
NBNodeCont nc,
NBEdgeCont ec,
SUMOReal  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 429 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(), SUMOReal, toString(), NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, and WRITE_WARNING.

Referenced by dict_buildNBEdges().

void NIVissimEdge::checkDistrictConnectionExistanceAt ( SUMOReal  pos)

Definition at line 854 of file NIVissimEdge.cpp.

References myDistrictConnections.

Referenced by NIVissimDistrictConnection::checkEdgeEnd().

void NIVissimEdge::checkUnconnectedLaneSpeeds ( )
private
void NIVissimAbstractEdge::clearDict ( )
staticinherited
SUMOReal NIVissimAbstractEdge::crossesAtPoint ( const Position p1,
const Position p2 
) const
inherited
bool NIVissimAbstractEdge::crossesEdge ( NIVissimAbstractEdge c) const
inherited
Position NIVissimAbstractEdge::crossesEdgeAtPoint ( NIVissimAbstractEdge c) const
inherited
void NIVissimEdge::dict_buildNBEdges ( NBDistrictCont dc,
NBNodeCont nc,
NBEdgeCont ec,
SUMOReal  offset 
)
static

Builds NBEdges from the VissimEdges within the dictionary.

Definition at line 250 of file NIVissimEdge.cpp.

References buildNBEdge(), and myDict.

Referenced by NIImporter_Vissim::postLoadBuild().

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

Adds the edge to the dictionary.

Definition at line 165 of file NIVissimEdge.cpp.

References myDict.

NIVissimEdge * NIVissimEdge::dictionary ( int  id)
static

Returns the named edge from the dictionary.

Definition at line 177 of file NIVissimEdge.cpp.

References myDict.

Position NIVissimEdge::getBegin2D ( ) const

Returns the begin position of the edge

Definition at line 836 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myGeom.

NIVissimEdge * NIVissimEdge::getBestIncoming ( ) const
NIVissimEdge * NIVissimEdge::getBestOutgoing ( ) const
const std::vector< int > & NIVissimAbstractEdge::getDisturbances ( ) const
inherited
Position NIVissimEdge::getEnd2D ( ) const

Returns the end position of the edge.

Definition at line 842 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myGeom.

SUMOReal NIVissimEdge::getLength ( ) const

Returns the length of the node.

Definition at line 848 of file NIVissimEdge.cpp.

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

Referenced by setDistrictSpeed().

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.

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

Definition at line 533 of file NIVissimEdge.cpp.

References NBDistribution::dictionary(), SUMOReal, and WRITE_WARNING.

Referenced by propagateSpeed().

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

Definition at line 980 of file NIVissimEdge.cpp.

References myToTreatAsSame.

Referenced by NIVissimConnectionCluster::extendByToTreatAsSame().

std::vector< int > NIVissimAbstractEdge::getWithin ( const AbstractPoly p,
SUMOReal  offset = 0.0 
)
staticinherited
bool NIVissimAbstractEdge::hasNodeCluster ( ) const
inherited

Definition at line 168 of file NIVissimAbstractEdge.cpp.

References NIVissimAbstractEdge::myNode.

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

Definition at line 801 of file NIVissimEdge.cpp.

References myConnectionClusters.

bool NIVissimAbstractEdge::overlapsWith ( const AbstractPoly p,
SUMOReal  offset = 0.0 
) const
inherited
void NIVissimEdge::propagateOwn ( )
private
void NIVissimEdge::removeFromConnectionCluster ( NIVissimConnectionCluster c)

Definition at line 817 of file NIVissimEdge.cpp.

References myConnectionClusters.

Referenced by NIVissimConnectionCluster::recheckEdges().

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 986 of file NIVissimEdge.cpp.

References myLanesWithMissingSpeeds, and WRITE_WARNING.

Referenced by NIImporter_Vissim::postLoadBuild().

std::pair< NBNode *, NBNode * > NIVissimEdge::resolveSameNode ( NBNodeCont nc,
SUMOReal  offset,
NBNode prevFrom,
NBNode prevTo 
)
private
void NIVissimEdge::setNodeCluster ( int  nodeid)
virtual

Implements NIVissimAbstractEdge.

Definition at line 778 of file NIVissimEdge.cpp.

References NIVissimAbstractEdge::myNode.

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

Definition at line 867 of file NIVissimEdge.cpp.

References myPatchedSpeeds.

void NIVissimAbstractEdge::splitAndAssignToNodes ( )
staticinherited
void NIVissimAbstractEdge::splitAssigning ( )
inherited
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 113 of file NIVissimEdge.h.

References myAmWithinJunction.

Referenced by NIVissimConnection::buildEdgeConnections().

Friends And Related Function Documentation

friend class NIVissimNodeDef_Edges
friend

Definition at line 120 of file NIVissimEdge.h.

friend class NIVissimNodeDef_Poly
friend

Definition at line 121 of file NIVissimEdge.h.

Field Documentation

bool NIVissimEdge::myAmWithinJunction
private

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

Definition at line 292 of file NIVissimEdge.h.

Referenced by buildNBEdge(), and wasWithinAJunction().

NIVissimClosedLanesVector NIVissimEdge::myClosedLanes
private

List of lanes closed on this edge.

Definition at line 272 of file NIVissimEdge.h.

Referenced by ~NIVissimEdge().

ConnectionClusters NIVissimEdge::myConnectionClusters
private

List of connection clusters along this edge.

Definition at line 275 of file NIVissimEdge.h.

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

NIVissimEdge::DictType NIVissimEdge::myDict
staticprivate
std::vector<SUMOReal> NIVissimEdge::myDistrictConnections
private
std::vector<int> NIVissimAbstractEdge::myDisturbances
protectedinherited
int NIVissimAbstractEdge::myID
protectedinherited
std::vector<int> NIVissimEdge::myIncomingConnections
private

List of connections incoming to this edge.

Definition at line 278 of file NIVissimEdge.h.

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

std::vector<SUMOReal> NIVissimEdge::myLaneSpeeds
private
std::vector< std::string > NIVissimEdge::myLanesWithMissingSpeeds
staticprivate

Definition at line 304 of file NIVissimEdge.h.

Referenced by buildNBEdge(), and reportUnsetSpeeds().

int NIVissimEdge::myMaxID = 0
staticprivate

The current maximum id; needed for further id assignment.

Definition at line 302 of file NIVissimEdge.h.

Referenced by NIVissimEdge().

std::string NIVissimEdge::myName
private

The name of the edge.

Definition at line 260 of file NIVissimEdge.h.

Referenced by buildNBEdge().

int NIVissimAbstractEdge::myNode
protectedinherited
unsigned int NIVissimEdge::myNoLanes
private

The number of lanes the edge has.

Definition at line 266 of file NIVissimEdge.h.

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

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

List of connections outgoing from this edge.

Definition at line 281 of file NIVissimEdge.h.

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

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

Definition at line 285 of file NIVissimEdge.h.

Referenced by propagateSpeed(), and setSpeed().

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

Definition at line 289 of file NIVissimEdge.h.

Referenced by addToTreatAsSame(), and getToTreatAsSame().

std::string NIVissimEdge::myType
private

The tape of the edge.

Definition at line 263 of file NIVissimEdge.h.

Referenced by buildNBEdge().

SUMOReal NIVissimEdge::myZuschlag1
private

Additional load values for this edge.

Definition at line 269 of file NIVissimEdge.h.

SUMOReal NIVissimEdge::myZuschlag2
private

Definition at line 269 of file NIVissimEdge.h.


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