47 : myCurrentNumericalLaneID(0), myCurrentNumericalEdgeID(0), myEdges(0), myCurrentLaneIndex(-1) {
64 const std::string& streetName,
65 const std::string& edgeType,
66 const std::string& routingType,
68 const std::string& bidi,
91 double maxSpeed,
double friction,
double length,
95 int index,
bool isRampAccel,
96 const std::string& type,
98 MSLane* lane =
new MSLane(
id, maxSpeed, friction, length,
myActiveEdge,
myCurrentNumericalLaneID++, shape, width, permissions, changeLeft, changeRight, index, isRampAccel, type, outlineShape);
117 std::stringstream ss;
132 if (
myLaneStorage->back()->getLaneStopOffsets().isDefined()) {
159 if (!l->getLaneStopOffsets().isDefined()) {
176 std::vector<MSLane*>* lanes =
new std::vector<MSLane*>();
202 if (oppo ==
nullptr) {
203 WRITE_ERRORF(
"Unknown neigh lane '%' for lane '%'", item.second, item.first->getID());
205 item.first->setOpposite(oppo);
209 std::set<const MSLane*> checked;
211 if (item.first->getOpposite() !=
nullptr) {
212 if (item.first->getOpposite()->getOpposite() != item.first) {
213 if (checked.count(item.first->getOpposite()) == 0) {
214 WRITE_WARNINGF(
TL(
"Asymmetrical neigh lane '%' for lane '%'"), item.second, item.first->getID());
215 item.first->getOpposite()->setOpposite(item.first);
217 throw ProcessError(
TLF(
"Mutually inconsistent neigh lane definitions for lanes '%', '%' and '%'",
218 item.first->getID(), item.first->getOpposite()->getID(),
Named::getIDSecure(item.first->getOpposite()->getOpposite())));
221 checked.insert(item.first);
222 checked.insert(item.first->getOpposite());
226 edge->closeBuilding();
229 edge->rebuildAllowedTargets(
false);
234 if (edge->isInternal()) {
235 if (edge->getNumSuccessors() != 1 || edge->getNumPredecessors() != 1) {
236 throw ProcessError(
TLF(
"Internal edge '%' is not properly connected (probably a manually modified net.xml).", edge->getID()));
238 if (edge->getSuccessors()[0]->isRoundabout() || edge->getPredecessors()[0]->isRoundabout()) {
239 edge->markAsRoundabout();
251 item.first->checkAndRegisterBiDirEdge(item.second);
257 e->checkAndRegisterBiDirEdge();
262 edge->buildLaneChanger();
270 const std::string& streetName,
const std::string& edgeType,
const std::string& routingType,
271 const int priority,
const double distance) {
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#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...
long long 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::pair< int, double > MMVersion
(M)ajor/(M)inor version for written networks and default version for loading
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.
static void clear()
Clears the dictionary.
static void setMesoIgnoredVClasses(SVCPermissions ignored)
void initialize(const std::vector< MSLane * > *lanes)
Initialize the 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....
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Representation of a lane in the micro simulation.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
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
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::vector< std::pair< MSLane *, std::string > > myOppositeLanes
std::string reportCurrentEdgeOrLane() const
Return info about currently processed 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.
int myCurrentNumericalLaneID
A running number for lane numbering.
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)
SumoXMLEdgeFunc getCurrentEdgeFunction() const
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).
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.
NLEdgeControlBuilder()
Constructor.
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.
std::map< MSEdge *, std::string, ComparatorNumericalIdLess > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
MSEdgeControl * build(const MMVersion &networkVersion)
builds the MSEdgeControl-class which holds all edges
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
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