Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NLEdgeControlBuilder Class Reference

Interface for building edges. More...

#include <NLEdgeControlBuilder.h>

Inheritance diagram for NLEdgeControlBuilder:
[legend]
Collaboration diagram for NLEdgeControlBuilder:
[legend]

Public Member Functions

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

Protected Member Functions

void applyDefaultStopOffsetsToLanes ()
 
void setDefaultStopOffset (const StopOffset &stopOffset)
 set the stopOffset for the last added lane.
 
void updateCurrentLaneStopOffset (const StopOffset &stopOffset)
 set the stopOffset for the last added lane.
 

Protected Attributes

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

Private Member Functions

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

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 55 of file NLEdgeControlBuilder.h.

Constructor & Destructor Documentation

◆ NLEdgeControlBuilder() [1/2]

NLEdgeControlBuilder::NLEdgeControlBuilder ( )

Constructor.

Definition at line 46 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, and myLaneStorage.

◆ ~NLEdgeControlBuilder()

NLEdgeControlBuilder::~NLEdgeControlBuilder ( )
virtual

Destructor.

Definition at line 53 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 256 of file NLEdgeControlBuilder.cpp.

References myActiveEdge, and MSEdge::setCrossingEdges().

Referenced by NLHandler::beginEdgeParsing().

Here is the caller graph for this function:

◆ addLane()

MSLane * NLEdgeControlBuilder::addLane ( const std::string &  id,
double  maxSpeed,
double  friction,
double  length,
const PositionVector shape,
double  width,
SVCPermissions  permissions,
SVCPermissions  changeLeft,
SVCPermissions  changeRight,
int  index,
bool  isRampAccel,
const std::string &  type,
const PositionVector outlineShape 
)
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().

Here is the caller graph for this function:

◆ 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 158 of file NLEdgeControlBuilder.cpp.

References myLaneStorage, and myOppositeLanes.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ addStopOffsets()

void NLEdgeControlBuilder::addStopOffsets ( const StopOffset stopOffsets)

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

Definition at line 96 of file NLEdgeControlBuilder.cpp.

References myCurrentLaneIndex, setDefaultStopOffset(), and updateCurrentLaneStopOffset().

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ applyDefaultStopOffsetsToLanes()

void NLEdgeControlBuilder::applyDefaultStopOffsetsToLanes ( )
protected

Definition at line 143 of file NLEdgeControlBuilder.cpp.

References StopOffset::isDefined(), myActiveEdge, myCurrentDefaultStopOffset, and myLaneStorage.

Referenced by closeEdge().

Here is the caller graph for this function:

◆ 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,
double  distance 
)

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 59 of file NLEdgeControlBuilder.cpp.

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

Referenced by NLHandler::beginEdgeParsing().

Here is the caller graph for this function:

◆ build()

MSEdgeControl * NLEdgeControlBuilder::build ( const MMVersion networkVersion)

builds the MSEdgeControl-class which holds all edges

Definition at line 183 of file NLEdgeControlBuilder.cpp.

References MELoop::buildSegmentsFor(), deprecatedVehicleClassesSeen, MSLane::dictionary(), OptionsCont::getOptions(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, MSGlobals::gUsingInternalLanes, myBidiEdges, myEdges, myOppositeLanes, parseVehicleClasses(), MSEdge::setMesoIgnoredVClasses(), TL, TLF, toString(), WRITE_ERRORF, and WRITE_WARNINGF.

Referenced by NLBuilder::buildNet().

Here is the caller graph for this function:

◆ buildEdge()

MSEdge * NLEdgeControlBuilder::buildEdge ( const std::string &  id,
const SumoXMLEdgeFunc  function,
const std::string &  streetName,
const std::string &  edgeType,
const int  priority,
const double  distance 
)
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 251 of file NLEdgeControlBuilder.cpp.

References myCurrentNumericalEdgeID.

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

Here is the caller graph for this function:

◆ 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 164 of file NLEdgeControlBuilder.cpp.

References applyDefaultStopOffsetsToLanes(), MSEdge::initialize(), myActiveEdge, myCurrentDefaultStopOffset, myLaneStorage, and StopOffset::reset().

Referenced by NLHandler::closeEdge().

Here is the caller graph for this function:

◆ 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 177 of file NLEdgeControlBuilder.cpp.

References myCurrentLaneIndex.

Referenced by NLHandler::myEndElement().

Here is the caller graph for this function:

◆ 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 106 of file NLEdgeControlBuilder.cpp.

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

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ setDefaultStopOffset()

void NLEdgeControlBuilder::setDefaultStopOffset ( const StopOffset stopOffset)
protected

set the stopOffset for the last added lane.

Definition at line 133 of file NLEdgeControlBuilder.cpp.

References Named::getID(), StopOffset::isDefined(), myActiveEdge, myCurrentDefaultStopOffset, and WRITE_WARNING.

Referenced by addStopOffsets().

Here is the caller graph for this function:

◆ updateCurrentLaneStopOffset()

void NLEdgeControlBuilder::updateCurrentLaneStopOffset ( const StopOffset stopOffset)
protected

set the stopOffset for the last added lane.

Definition at line 117 of file NLEdgeControlBuilder.cpp.

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

Referenced by addStopOffsets().

Here is the caller graph for this function:

Field Documentation

◆ myActiveEdge

◆ myBidiEdges

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

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

Definition at line 175 of file NLEdgeControlBuilder.h.

Referenced by beginEdgeParsing(), and build().

◆ myCurrentDefaultStopOffset

StopOffset NLEdgeControlBuilder::myCurrentDefaultStopOffset
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 166 of file NLEdgeControlBuilder.h.

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

◆ myCurrentLaneIndex

int NLEdgeControlBuilder::myCurrentLaneIndex
protected

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

Definition at line 169 of file NLEdgeControlBuilder.h.

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

◆ myCurrentNumericalEdgeID

int NLEdgeControlBuilder::myCurrentNumericalEdgeID
protected

A running number for edge numbering.

Definition at line 157 of file NLEdgeControlBuilder.h.

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

◆ myCurrentNumericalLaneID

int NLEdgeControlBuilder::myCurrentNumericalLaneID
protected

A running number for lane numbering.

Definition at line 154 of file NLEdgeControlBuilder.h.

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

◆ myEdges

MSEdgeVector NLEdgeControlBuilder::myEdges
protected

Temporary, internal storage for built edges.

Definition at line 160 of file NLEdgeControlBuilder.h.

Referenced by beginEdgeParsing(), and build().

◆ myLaneStorage

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

◆ myOppositeLanes

std::vector<std::pair<MSLane*, std::string> > NLEdgeControlBuilder::myOppositeLanes
protected

Definition at line 177 of file NLEdgeControlBuilder.h.

Referenced by addNeigh(), and build().


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