46 : myCurrentNumericalLaneID(0), myCurrentNumericalEdgeID(0), myEdges(0), myCurrentLaneIndex(-1) {
60 const std::string& streetName,
61 const std::string& edgeType,
63 const std::string& bidi,
80 double maxSpeed,
double length,
84 int index,
bool isRampAccel,
85 const std::string& type) {
86 MSLane* lane =
new MSLane(
id, maxSpeed, length,
myActiveEdge,
myCurrentNumericalLaneID++, shape, width, permissions, changeLeft, changeRight, index, isRampAccel, type);
105 std::stringstream ss;
120 if (
myLaneStorage->back()->getLaneStopOffsets().isDefined()) {
147 if (!l->getLaneStopOffsets().isDefined()) {
164 std::vector<MSLane*>* lanes =
new std::vector<MSLane*>();
185 for (MSEdgeVector::iterator i1 =
myEdges.begin(); i1 !=
myEdges.end(); i1++) {
186 (*i1)->closeBuilding();
188 for (MSEdgeVector::iterator i1 =
myEdges.begin(); i1 !=
myEdges.end(); i1++) {
189 (*i1)->buildLaneChanger();
193 for (MSEdgeVector::iterator i1 =
myEdges.begin(); i1 !=
myEdges.end(); i1++) {
197 throw ProcessError(
"Internal edge '" + edge->
getID() +
"' is not properly connected (probably a manually modified net.xml).");
210 if (
myBidiEdges.size() > 0 || networkVersion > 1.0) {
212 item.first->checkAndRegisterBiDirEdge(item.second);
218 e->checkAndRegisterBiDirEdge();
227 const std::string& streetName,
const std::string& edgeType,
const int priority,
const double distance) {
#define WRITE_WARNING(msg)
std::set< std::string > deprecatedVehicleClassesSeen
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Stores edges and lanes, performs moving of vehicle.
A road/street connecting two junctions.
void setCrossingEdges(const std::vector< std::string > &crossingEdges)
Sets the crossed edge ids for a crossing edge.
int getNumSuccessors() const
Returns the number of edges that may be reached from this edge.
static void setMesoIgnoredVClasses(SVCPermissions ignored)
const MSEdgeVector & getPredecessors() const
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
bool isInternal() const
return whether this edge is an internal edge
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
int getNumPredecessors() const
Returns the number of edges this edge is connected to.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Representation of a lane in the micro simulation.
std::map< MSEdge *, std::string > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
virtual MSEdge * closeEdge()
Closes the building of an edge; The edge is completely described by now and may not be opened again.
virtual void addNeigh(const std::string id)
Adds a neighbor to the current lane.
MSEdgeVector myEdges
Temporary, internal storage for built edges.
MSEdge * myActiveEdge
pointer to the currently chosen edge
MSEdgeControl * build(double networkVersion)
builds the MSEdgeControl-class which holds all edges
void updateCurrentLaneStopOffset(const StopOffset &stopOffset)
set the stopOffset for the last added lane.
void closeLane()
Closes the building of a lane; The edge is completely described by now and may not be opened again.
void applyDefaultStopOffsetsToLanes()
int myCurrentLaneIndex
The index of the currently active lane (-1 if none is active)
std::string reportCurrentEdgeOrLane() const
Return info about currently processed edge or lane.
int myCurrentNumericalLaneID
A running number for lane numbering.
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.
virtual MSLane * addLane(const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, SVCPermissions changeLeft, SVCPermissions changeRight, int index, bool isRampAccel, const std::string &type)
Adds a lane to the current edge.
void setDefaultStopOffset(const StopOffset &stopOffset)
set the stopOffset for the last added lane.
virtual void addCrossingEdges(const std::vector< std::string > &)
add the crossingEdges in a crossing edge if present
void addStopOffsets(const StopOffset &stopOffsets)
process a stopOffset element (originates either from the active edge or lane).
NLEdgeControlBuilder()
Constructor.
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)
std::vector< MSLane * > * myLaneStorage
pointer to a temporary lane storage
int myCurrentNumericalEdgeID
A running number for edge numbering.
StopOffset myCurrentDefaultStopOffset
The default stop offset for all lanes belonging to the active edge (this is set if the edge was given...
virtual ~NLEdgeControlBuilder()
Destructor.
const std::string & getID() const
Returns the id.
static OptionsCont & getOptions()
Retrieves the options.
bool isDefined() const
check if stopOffset was defined
void reset()
reset stopOffset