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, 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 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, and myLaneStorage.
|
virtual |
|
private |
invalidated copy constructor
|
virtual |
add the crossingEdges in a crossing edge if present
[in] | the | vector of crossed edges id |
Definition at line 256 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, and MSEdge::setCrossingEdges().
Referenced by NLHandler::beginEdgeParsing().
|
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 80 of file NLEdgeControlBuilder.cpp.
References myActiveEdge, myCurrentLaneIndex, myCurrentNumericalLaneID, and myLaneStorage.
Referenced by NLHandler::addLane().
|
virtual |
Adds a neighbor to the current lane.
[in] | id | The lane's id |
Definition at line 158 of file NLEdgeControlBuilder.cpp.
References myLaneStorage, and myOppositeLanes.
Referenced by NLHandler::myStartElement().
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().
|
protected |
Definition at line 143 of file NLEdgeControlBuilder.cpp.
References StopOffset::isDefined(), 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, | ||
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.
Referenced by NLHandler::beginEdgeParsing().
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().
|
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 251 of file NLEdgeControlBuilder.cpp.
References myCurrentNumericalEdgeID.
Referenced by NLHandler::addDistrict(), beginEdgeParsing(), and NLBuilder::build().
|
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().
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().
|
private |
invalidated assignment operator
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().
|
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().
|
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().
|
protected |
pointer to the currently chosen edge
Definition at line 163 of file NLEdgeControlBuilder.h.
Referenced by addCrossingEdges(), addLane(), GUIEdgeControlBuilder::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 175 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 166 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 169 of file NLEdgeControlBuilder.h.
Referenced by addLane(), GUIEdgeControlBuilder::addLane(), addStopOffsets(), closeLane(), and reportCurrentEdgeOrLane().
|
protected |
A running number for edge numbering.
Definition at line 157 of file NLEdgeControlBuilder.h.
Referenced by buildEdge(), and GUIEdgeControlBuilder::buildEdge().
|
protected |
A running number for lane numbering.
Definition at line 154 of file NLEdgeControlBuilder.h.
Referenced by addLane(), and GUIEdgeControlBuilder::addLane().
|
protected |
Temporary, internal storage for built edges.
Definition at line 160 of file NLEdgeControlBuilder.h.
Referenced by beginEdgeParsing(), and build().
|
protected |
pointer to a temporary lane storage
Definition at line 172 of file NLEdgeControlBuilder.h.
Referenced by addLane(), GUIEdgeControlBuilder::addLane(), addNeigh(), applyDefaultStopOffsetsToLanes(), beginEdgeParsing(), closeEdge(), NLEdgeControlBuilder(), updateCurrentLaneStopOffset(), and ~NLEdgeControlBuilder().
|
protected |
Definition at line 177 of file NLEdgeControlBuilder.h.
Referenced by addNeigh(), and build().