129 throw InvalidArgument(
"In preference for routingType '" + routingType +
"', priority must be positve");
133 for (std::string className : st.
getVector()) {
138 myNet.addPreference(routingType,
"", prio);
142 for (std::string typeName : st.
getVector()) {
143 myNet.addPreference(routingType, typeName, prio);
217 if (fromNode ==
nullptr) {
219 fromNode =
new RONode(from);
220 myNet.addNode(fromNode);
223 if (toNode ==
nullptr) {
226 myNet.addNode(toNode);
268 if (shape.size() < 2) {
275 if (permissions !=
SVCAll) {
276 myNet.setPermissionsFound();
279 if (maxSpeed > 0 && length > 0 &&
id.length() > 0) {
325 if (from ==
nullptr) {
326 throw ProcessError(
TLF(
"unknown from-edge '%' in connection", fromID));
331 if ((
int)from->getLanes().size() <= fromLane) {
332 throw ProcessError(
"invalid fromLane '" +
toString(fromLane) +
"' in connection from '" + fromID +
"'.");
334 if ((
int)to->
getLanes().size() <= toLane) {
335 throw ProcessError(
"invalid toLane '" +
toString(toLane) +
"' in connection to '" + toID +
"'.");
340 ROEdge* dummyVia =
nullptr;
342 if (allow ==
"" && disallow ==
"") {
345 myNet.setPermissionsFound();
348 dummyVia =
new ROEdge(
"dummyVia_" + from->getLanes()[fromLane]->getID() +
"->" + to->
getLanes()[toLane]->getID(),
349 from->getToJunction(), from->getToJunction(), permissions);
350 myNet.addEdge(dummyVia);
352 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane], dummyVia);
353 from->addSuccessor(to,
nullptr, dir);
356 if (via ==
nullptr) {
359 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane], via);
360 from->addSuccessor(to, via, dir);
391 if (edge ==
nullptr) {
414 if (edge ==
nullptr) {
418 WRITE_WARNINGF(
TL(
"Ignoring invalid access from non-pedestrian edge '%'."), edge->getID());
432 const Position accPos =
myNet.getLane(lane)->geometryPositionAtOffset(pos);
454 for (
const std::string& eID : desc) {
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const SVCPermissions SVCAll
all VClasses are allowed
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
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
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NET
root element of a network file
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_RESTRICTION
begin/end of the description of an edge restriction
@ SUMO_TAG_PREFERENCE
begin/end of the description of an edge preferences
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_TAG_TYPE
type (edge)
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ TURN
The link is a 180 degree turn.
@ TURN_LEFTHAND
The link is a 180 degree turn (left-hand network).
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
@ LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
@ SUMO_ATTR_CONV_BOUNDARY
@ SUMO_ATTR_ORIG_BOUNDARY
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ SUMO_ATTR_STATE
The state of a link.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
A point in 2D or 3D with translation and scaling methods.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Interface for building instances of router-edges.
A basic edge for routing applications.
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
double getLength() const
Returns the length of the edge.
bool isCrossing() const
return whether this edge is a pedestrian crossing
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
void setTimePenalty(double value)
A single lane the router may use.
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal, const double minorPenalty, double tlsPenalty, double turnaroundPenalty)
Constructor.
void parseAccess(const SUMOSAXAttributes &attrs)
const double myMinorPenalty
time penalty for passing a minor link
virtual void myEndElement(int element)
Called when a closing tag occurs.
MMVersion myNetworkVersion
the loaded network version
virtual ~RONetHandler()
Destructor.
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::string myCurrentName
The name of the edge/node that is currently processed.
const double myTLSPenalty
void addParam(const SUMOSAXAttributes &attrs)
assign arbitrary vehicle parameters
ROEdge * myCurrentEdge
The currently built edge.
std::string myCurrentTypeID
The id of the currently processed edge type.
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
const bool myIgnoreInternal
whether to ignore junction internal edges
void parseConnection(const SUMOSAXAttributes &attrs)
std::map< ROEdge *, std::string > myBidiEdges
temporary storage for bidi attributes (to be resolved after loading all edges)
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
RONet & myNet
The net to store the information into.
const double myTurnaroundPenalty
void parseDistrict(const SUMOSAXAttributes &attrs)
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
The router's network representation.
Base class for nodes used by the router.
void addOutgoing(ROEdge *edge)
void addIncoming(ROEdge *edge)
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOSAXHandler(const std::string &file="", const std::string &expectedRoot="")
Constructor.
Definition of vehicle stop (position and duration).
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
static StringBijection< LinkState > LinkStates
link states
static std::string getJunctionIDFromInternalEdge(const std::string internalEdge)
return the junction id when given an edge of type internal, crossing or WalkingArea
std::vector< std::string > getVector()
return vector of strings
static MMVersion toVersion(const std::string &sData)
parse a (network) version string
*brief user defined string literal for JSON values *sa std::size_t n