![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Interface for building edges. More...
#include <NLEdgeControlBuilder.h>
Public Member Functions | |
| virtual void | addCrossingEdges (const std::vector< std::string > &) |
| add the crossingEdges in a crossing edge if present | |
| virtual MSLane * | 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) |
| 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, const std::string &routingType, int priority, const std::string &bidi, double distance) |
| Begins building of an MSEdge. | |
| MSEdgeControl * | build (const MMVersion &networkVersion) |
| builds the MSEdgeControl-class which holds all edges | |
| virtual MSEdge * | buildEdge (const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const std::string &routingType, const int priority, const double distance) |
| Builds an edge instance (MSEdge in this case). | |
| virtual MSEdge * | closeEdge () |
| 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 | |
| MSEdge * | myActiveEdge |
| pointer to the currently chosen edge | |
| std::map< MSEdge *, std::string, ComparatorNumericalIdLess > | myBidiEdges |
| 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 | |
| NLEdgeControlBuilder & | operator= (const NLEdgeControlBuilder &s) |
| invalidated assignment operator | |
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.
Definition at line 55 of file NLEdgeControlBuilder.h.
| NLEdgeControlBuilder::NLEdgeControlBuilder | ( | ) |
Constructor.
Definition at line 46 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentLaneIndex, myCurrentNumericalEdgeID, myCurrentNumericalLaneID, myEdges, and myLaneStorage.
Referenced by GUIEdgeControlBuilder::GUIEdgeControlBuilder(), NLEdgeControlBuilder(), and operator=().
|
virtual |
|
private |
invalidated copy constructor
References NLEdgeControlBuilder().
|
virtual |
add the crossingEdges in a crossing edge if present
| [in] | the | vector of crossed edges id |
Definition at line 268 of file NLEdgeControlBuilder.cpp.
References myActiveEdge.
|
virtual |
Adds a lane to the current edge.
| [in] | id | The lane's id |
| [in] | maxSpeed | The speed allowed on this lane |
| [in] | length | The lane's length |
| [in] | shape | The shape of the lane |
| [in] | width | The width of the lane |
| [in] | permissions | Encoding of vehicle classes that may drive on this lane |
| [in] | index | The index of this lane within its parent edge |
Reimplemented in GUIEdgeControlBuilder.
Definition at line 81 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentLaneIndex, myCurrentNumericalLaneID, and myLaneStorage.
|
virtual |
Adds a neighbor to the current lane.
| [in] | id | The lane's id |
Definition at line 159 of file NLEdgeControlBuilder.cpp.
References myLaneStorage, and myOppositeLanes.
| void NLEdgeControlBuilder::addStopOffsets | ( | const StopOffset & | stopOffsets | ) |
process a stopOffset element (originates either from the active edge or lane).
Definition at line 97 of file NLEdgeControlBuilder.cpp.
References myCurrentLaneIndex, setDefaultStopOffset(), and updateCurrentLaneStopOffset().
|
protected |
Definition at line 144 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentDefaultStopOffset, and myLaneStorage.
Referenced by closeEdge().
| void NLEdgeControlBuilder::beginEdgeParsing | ( | const std::string & | id, |
| const SumoXMLEdgeFunc | function, | ||
| const std::string & | streetName, | ||
| const std::string & | edgeType, | ||
| const std::string & | routingType, | ||
| 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.
| [in] | id | The id of the edge |
| [in] | function | The function of the edge |
| [in] | streetName | The street name of the edge |
| InvalidArgument | If 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.
| MSEdgeControl * NLEdgeControlBuilder::build | ( | const MMVersion & | networkVersion | ) |
builds the MSEdgeControl-class which holds all edges
Definition at line 184 of file NLEdgeControlBuilder.cpp.
References deprecatedVehicleClassesSeen, MSLane::dictionary(), Named::getIDSecure(), OptionsCont::getOptions(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, MSGlobals::gUsingInternalLanes, myBidiEdges, myEdges, myOppositeLanes, parseVehicleClasses(), MSEdge::setMesoIgnoredVClasses(), TL, TLF, toString(), WRITE_ERRORF, and WRITE_WARNINGF.
|
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.
| [in] | id | The id of the edge to build |
| [in] | streetName | The street name of the edge to build |
Reimplemented in GUIEdgeControlBuilder.
Definition at line 262 of file NLEdgeControlBuilder.cpp.
References myCurrentNumericalEdgeID.
Referenced by beginEdgeParsing().
|
virtual |
Closes the building of an edge; The edge is completely described by now and may not be opened again.
Definition at line 165 of file NLEdgeControlBuilder.cpp.
References applyDefaultStopOffsetsToLanes(), myActiveEdge, myCurrentDefaultStopOffset, and myLaneStorage.
| 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 178 of file NLEdgeControlBuilder.cpp.
References myCurrentLaneIndex.
|
private |
invalidated assignment operator
References NLEdgeControlBuilder().
| std::string NLEdgeControlBuilder::reportCurrentEdgeOrLane | ( | ) | const |
Return info about currently processed edge or lane.
Definition at line 107 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, and myCurrentLaneIndex.
|
protected |
set the stopOffset for the last added lane.
Definition at line 134 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentDefaultStopOffset, and WRITE_WARNING.
Referenced by addStopOffsets().
|
protected |
set the stopOffset for the last added lane.
Definition at line 118 of file NLEdgeControlBuilder.cpp.
References StopOffset::isDefined(), myActiveEdge, myLaneStorage, toString(), and WRITE_WARNING.
Referenced by addStopOffsets().
|
protected |
pointer to the currently chosen edge
Definition at line 165 of file NLEdgeControlBuilder.h.
Referenced by addCrossingEdges(), GUIEdgeControlBuilder::addLane(), addLane(), applyDefaultStopOffsetsToLanes(), beginEdgeParsing(), closeEdge(), NLEdgeControlBuilder(), reportCurrentEdgeOrLane(), setDefaultStopOffset(), and updateCurrentLaneStopOffset().
|
protected |
temporary storage for bidi attributes (to be resolved after loading all edges)
Definition at line 177 of file NLEdgeControlBuilder.h.
Referenced by beginEdgeParsing(), and build().
|
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 168 of file NLEdgeControlBuilder.h.
Referenced by applyDefaultStopOffsetsToLanes(), closeEdge(), and setDefaultStopOffset().
|
protected |
The index of the currently active lane (-1 if none is active).
Definition at line 171 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::addLane(), addLane(), addStopOffsets(), closeLane(), NLEdgeControlBuilder(), and reportCurrentEdgeOrLane().
|
protected |
A running number for edge numbering.
Definition at line 159 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::buildEdge(), buildEdge(), and NLEdgeControlBuilder().
|
protected |
A running number for lane numbering.
Definition at line 156 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::addLane(), addLane(), and NLEdgeControlBuilder().
|
protected |
Temporary, internal storage for built edges.
Definition at line 162 of file NLEdgeControlBuilder.h.
Referenced by beginEdgeParsing(), build(), and NLEdgeControlBuilder().
|
protected |
pointer to a temporary lane storage
Definition at line 174 of file NLEdgeControlBuilder.h.
Referenced by GUIEdgeControlBuilder::addLane(), addLane(), addNeigh(), applyDefaultStopOffsetsToLanes(), beginEdgeParsing(), closeEdge(), NLEdgeControlBuilder(), updateCurrentLaneStopOffset(), and ~NLEdgeControlBuilder().
|
protected |
Definition at line 179 of file NLEdgeControlBuilder.h.
Referenced by addNeigh(), and build().