SUMO - Simulation of Urban MObility
NLEdgeControlBuilder Class Reference

Interface for building edges. More...

#include <NLEdgeControlBuilder.h>

Inheritance diagram for NLEdgeControlBuilder:
Inheritance graph
Collaboration diagram for NLEdgeControlBuilder:
Collaboration graph

Public Member Functions

virtual void addCrossingEdges (const std::vector< std::string > &)
 add the crossingEdges in a crossing edge if present More...
 
virtual MSLaneaddLane (const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel)
 Adds a lane to the current edge. More...
 
virtual void addNeigh (const std::string id)
 Adds a neighbor to the current lane. More...
 
void addStopOffsets (const std::map< SVCPermissions, double > &stopOffsets)
 process a stopOffset element (originates either from the active edge or lane). More...
 
void beginEdgeParsing (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, const std::string &bidi)
 Begins building of an MSEdge. More...
 
MSEdgeControlbuild (double networkVersion)
 builds the MSEdgeControl-class which holds all edges More...
 
virtual MSEdgebuildEdge (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority)
 Builds an edge instance (MSEdge in this case) More...
 
virtual MSEdgecloseEdge ()
 Closes the building of an edge; The edge is completely described by now and may not be opened again. More...
 
void closeLane ()
 Closes the building of a lane; The edge is completely described by now and may not be opened again. More...
 
 NLEdgeControlBuilder ()
 Constructor. More...
 
std::string reportCurrentEdgeOrLane () const
 Return info about currently processed edge or lane. More...
 
virtual ~NLEdgeControlBuilder ()
 Destructor. More...
 

Protected Member Functions

void applyDefaultStopOffsetsToLanes ()
 
void setDefaultStopOffsets (std::map< SVCPermissions, double > stopOffsets)
 set the stopOffset for the last added lane. More...
 
void updateCurrentLaneStopOffsets (const std::map< SVCPermissions, double > &stopOffsets)
 set the stopOffset for the last added lane. More...
 

Protected Attributes

MSEdgemyActiveEdge
 pointer to the currently chosen edge More...
 
std::map< MSEdge *, std::string > myBidiEdges
 temporary storage for bidi attributes (to be resolved after loading all edges) More...
 
std::map< SVCPermissions, double > myCurrentDefaultStopOffsets
 The default stop offset for all lanes belonging to the active edge (this is set if the edge was given a stopOffset child) More...
 
int myCurrentLaneIndex
 The index of the currently active lane (-1 if none is active) More...
 
int myCurrentNumericalEdgeID
 A running number for edge numbering. More...
 
int myCurrentNumericalLaneID
 A running number for lane numbering. More...
 
MSEdgeVector myEdges
 Temporary, internal storage for built edges. More...
 
std::vector< MSLane * > * myLaneStorage
 pointer to a temporary lane storage More...
 

Private Member Functions

 NLEdgeControlBuilder (const NLEdgeControlBuilder &s)
 invalidated copy constructor More...
 
NLEdgeControlBuilderoperator= (const NLEdgeControlBuilder &s)
 invalidated assignment operator More...
 

Detailed Description

Interface for building edges.

This class is the container for MSEdge-instances while they are build.

While building instances of MSEdge, these are stored in a list. The list of edges is later split into two lists, one containing single-lane-edges and one containing multi-lane-edges.

Todo:
Assignment of lanes is not really well. Should be reworked after shapes are given as params.

Definition at line 58 of file NLEdgeControlBuilder.h.

Constructor & Destructor Documentation

◆ NLEdgeControlBuilder() [1/2]

NLEdgeControlBuilder::NLEdgeControlBuilder ( )

Constructor.

Definition at line 47 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, and myLaneStorage.

◆ ~NLEdgeControlBuilder()

NLEdgeControlBuilder::~NLEdgeControlBuilder ( )
virtual

Destructor.

Definition at line 54 of file NLEdgeControlBuilder.cpp.

References myLaneStorage.

◆ NLEdgeControlBuilder() [2/2]

NLEdgeControlBuilder::NLEdgeControlBuilder ( const NLEdgeControlBuilder s)
private

invalidated copy constructor

Member Function Documentation

◆ addCrossingEdges()

void NLEdgeControlBuilder::addCrossingEdges ( const std::vector< std::string > &  crossingEdges)
virtual

add the crossingEdges in a crossing edge if present

Parameters
[in]thevector of crossed edges id

Definition at line 229 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, and MSEdge::setCrossingEdges().

Referenced by NLHandler::beginEdgeParsing().

◆ addLane()

MSLane * NLEdgeControlBuilder::addLane ( const std::string &  id,
double  maxSpeed,
double  length,
const PositionVector shape,
double  width,
SVCPermissions  permissions,
int  index,
bool  isRampAccel 
)
virtual

Adds a lane to the current edge.

Parameters
[in]idThe lane's id
[in]maxSpeedThe speed allowed on this lane
[in]lengthThe lane's length
[in]shapeThe shape of the lane
[in]widthThe width of the lane
[in]permissionsEncoding of vehicle classes that may drive on this lane
[in]indexThe index of this lane within its parent edge
See also
SUMOVehicleClass
MSLane
Todo:
Definitely not a good way

Reimplemented in GUIEdgeControlBuilder.

Definition at line 80 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, myCurrentLaneIndex, myCurrentNumericalLaneID, and myLaneStorage.

Referenced by NLHandler::addLane().

◆ addNeigh()

void NLEdgeControlBuilder::addNeigh ( const std::string  id)
virtual

Adds a neighbor to the current lane.

Parameters
[in]idThe lane's id
See also
MSLane

Definition at line 157 of file NLEdgeControlBuilder.cpp.

References myLaneStorage.

Referenced by NLHandler::myStartElement().

◆ addStopOffsets()

void NLEdgeControlBuilder::addStopOffsets ( const std::map< SVCPermissions, double > &  stopOffsets)

process a stopOffset element (originates either from the active edge or lane).

Definition at line 92 of file NLEdgeControlBuilder.cpp.

References myCurrentLaneIndex, setDefaultStopOffsets(), and updateCurrentLaneStopOffsets().

Referenced by NLHandler::myStartElement().

◆ applyDefaultStopOffsetsToLanes()

void NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes ( )
protected

Definition at line 143 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, myCurrentDefaultStopOffsets, and myLaneStorage.

Referenced by closeEdge().

◆ beginEdgeParsing()

void NLEdgeControlBuilder::beginEdgeParsing ( const std::string &  id,
const SumoXMLEdgeFunc  function,
const std::string &  streetName,
const std::string &  edgeType,
int  priority,
const std::string &  bidi 
)

Begins building of an MSEdge.

Builds an instance of MSEdge using "buildEdge". Stores it as the current edge in "myActiveEdge" and appends it to the list of built edges ("myEdges").

The given information is used to build the edge.

Parameters
[in]idThe id of the edge
[in]functionThe function of the edge
[in]streetNameThe street name of the edge
Exceptions
InvalidArgumentIf an edge with the same name was already built

Definition at line 60 of file NLEdgeControlBuilder.cpp.

References buildEdge(), MSEdge::dictionary(), myActiveEdge, myBidiEdges, myEdges, and myLaneStorage.

Referenced by NLHandler::beginEdgeParsing().

◆ build()

◆ buildEdge()

MSEdge * NLEdgeControlBuilder::buildEdge ( const std::string &  id,
const SumoXMLEdgeFunc  function,
const std::string &  streetName,
const std::string &  edgeType,
const int  priority 
)
virtual

Builds an edge instance (MSEdge in this case)

Builds an MSEdge-instance using the given name and the current index "myCurrentNumericalEdgeID". Post-increments the index, returns the built edge.

Parameters
[in]idThe id of the edge to build
[in]streetNameThe street name of the edge to build

Reimplemented in GUIEdgeControlBuilder.

Definition at line 224 of file NLEdgeControlBuilder.cpp.

References myCurrentNumericalEdgeID.

Referenced by NLHandler::addDistrict(), and beginEdgeParsing().

◆ closeEdge()

MSEdge * NLEdgeControlBuilder::closeEdge ( )
virtual

Closes the building of an edge; The edge is completely described by now and may not be opened again.

Definition at line 163 of file NLEdgeControlBuilder.cpp.

References applyDefaultStopOffsetsToLanes(), MSEdge::initialize(), myActiveEdge, myCurrentDefaultStopOffsets, and myLaneStorage.

Referenced by NLHandler::closeEdge().

◆ closeLane()

void NLEdgeControlBuilder::closeLane ( )

Closes the building of a lane; The edge is completely described by now and may not be opened again.

Definition at line 176 of file NLEdgeControlBuilder.cpp.

References myCurrentLaneIndex.

Referenced by NLHandler::myEndElement().

◆ operator=()

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

invalidated assignment operator

◆ reportCurrentEdgeOrLane()

std::string NLEdgeControlBuilder::reportCurrentEdgeOrLane ( ) const

Return info about currently processed edge or lane.

Definition at line 104 of file NLEdgeControlBuilder.cpp.

References Named::getID(), myActiveEdge, and myCurrentLaneIndex.

Referenced by NLHandler::myStartElement().

◆ setDefaultStopOffsets()

void NLEdgeControlBuilder::setDefaultStopOffsets ( std::map< SVCPermissions, double >  stopOffsets)
protected

set the stopOffset for the last added lane.

Definition at line 131 of file NLEdgeControlBuilder.cpp.

References Named::getID(), myActiveEdge, myCurrentDefaultStopOffsets, and WRITE_WARNING.

Referenced by addStopOffsets().

◆ updateCurrentLaneStopOffsets()

void NLEdgeControlBuilder::updateCurrentLaneStopOffsets ( const std::map< SVCPermissions, double > &  stopOffsets)
protected

set the stopOffset for the last added lane.

Definition at line 115 of file NLEdgeControlBuilder.cpp.

References Named::getID(), myActiveEdge, myLaneStorage, and WRITE_WARNING.

Referenced by addStopOffsets().

Field Documentation

◆ myActiveEdge

◆ myBidiEdges

std::map<MSEdge*, std::string> NLEdgeControlBuilder::myBidiEdges
protected

temporary storage for bidi attributes (to be resolved after loading all edges)

Definition at line 176 of file NLEdgeControlBuilder.h.

Referenced by beginEdgeParsing(), and build().

◆ myCurrentDefaultStopOffsets

std::map<SVCPermissions, double> NLEdgeControlBuilder::myCurrentDefaultStopOffsets
protected

The default stop offset for all lanes belonging to the active edge (this is set if the edge was given a stopOffset child)

Definition at line 167 of file NLEdgeControlBuilder.h.

Referenced by applyDefaultStopOffsetsToLanes(), closeEdge(), and setDefaultStopOffsets().

◆ myCurrentLaneIndex

int NLEdgeControlBuilder::myCurrentLaneIndex
protected

The index of the currently active lane (-1 if none is active)

Definition at line 170 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), addLane(), addStopOffsets(), closeLane(), and reportCurrentEdgeOrLane().

◆ myCurrentNumericalEdgeID

int NLEdgeControlBuilder::myCurrentNumericalEdgeID
protected

A running number for edge numbering.

Definition at line 158 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::buildEdge(), and buildEdge().

◆ myCurrentNumericalLaneID

int NLEdgeControlBuilder::myCurrentNumericalLaneID
protected

A running number for lane numbering.

Definition at line 155 of file NLEdgeControlBuilder.h.

Referenced by GUIEdgeControlBuilder::addLane(), and addLane().

◆ myEdges

MSEdgeVector NLEdgeControlBuilder::myEdges
protected

Temporary, internal storage for built edges.

Definition at line 161 of file NLEdgeControlBuilder.h.

Referenced by beginEdgeParsing(), and build().

◆ myLaneStorage

std::vector<MSLane*>* NLEdgeControlBuilder::myLaneStorage
protected

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