51 myNetworkVersion(0, 0),
52 myEdgeBuilder(eb), myIgnoreInternal(ignoreInternal),
53 myCurrentName(), myCurrentEdge(nullptr), myCurrentStoppingPlace(nullptr),
54 myMinorPenalty(minorPenalty),
55 myTLSPenalty(tlsPenalty),
56 myTurnaroundPenalty(turnaroundPenalty)
193 if (fromNode ==
nullptr) {
195 fromNode =
new RONode(from);
199 if (toNode ==
nullptr) {
244 if (shape.size() < 2) {
251 if (permissions !=
SVCAll) {
255 if (maxSpeed > 0 && length > 0 &&
id.length() > 0) {
301 if (from ==
nullptr) {
302 throw ProcessError(
TLF(
"unknown from-edge '%' in connection", fromID));
307 if ((
int)from->getLanes().size() <= fromLane) {
308 throw ProcessError(
"invalid fromLane '" +
toString(fromLane) +
"' in connection from '" + fromID +
"'.");
310 if ((
int)to->
getLanes().size() <= toLane) {
311 throw ProcessError(
"invalid toLane '" +
toString(toLane) +
"' in connection to '" + toID +
"'.");
316 ROEdge* dummyVia =
nullptr;
318 if (allow ==
"" && disallow ==
"") {
324 dummyVia =
new ROEdge(
"dummyVia_" + from->getLanes()[fromLane]->getID() +
"->" + to->
getLanes()[toLane]->getID(),
325 from->getToJunction(), from->getToJunction(), permissions);
327 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane], dummyVia);
328 from->addSuccessor(to,
nullptr, dir);
331 if (via ==
nullptr) {
334 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane], via);
335 from->addSuccessor(to, via, dir);
366 if (edge ==
nullptr) {
389 if (edge ==
nullptr) {
393 WRITE_WARNINGF(
TL(
"Ignoring invalid access from non-pedestrian edge '%'."), edge->getID());
429 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_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.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
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.
virtual ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)=0
Builds an edge with the given name.
A basic edge for routing applications.
void setFunction(SumoXMLEdgeFunc func)
Sets the function of the edge.
void setRestrictions(const std::map< SUMOVehicleClass, double > *restrictions)
Sets the vehicle class specific speed limits of the edge.
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
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.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
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.
void setPermissionsFound()
RONode * getNode(const std::string &id) const
Retrieves an node from the network.
const std::map< SUMOVehicleClass, double > * getRestrictions(const std::string &id) const
Returns the restrictions for an edge type If no restrictions are present, 0 is returned.
void addStoppingPlace(const std::string &id, const SumoXMLTag category, SUMOVehicleParameter::Stop *stop)
bool addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource)
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
virtual bool addEdge(ROEdge *edge)
ROLane * getLane(const std::string &laneID) const
Retrieves a lane rom the network given its id.
void addNode(RONode *node)
ROEdge * getEdgeForLaneID(const std::string &laneID) const
Retrieves an edge from the network when the lane id is given.
bool addDistrict(const std::string id, ROEdge *source, ROEdge *sink)
Base class for nodes used by the router.
void addOutgoing(ROEdge *edge)
void addIncoming(ROEdge *edge)
void setPosition(const Position &p)
Sets the position of the node.
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.
SAX-handler base for SUMO-files.
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
double startPos
The stopping position start.
std::string actType
act Type (only used by Persons) (used by netedit)
double endPos
The stopping position end.
std::vector< std::tuple< std::string, double, double > > accessPos
lanes and positions connected to this stop (only used by duarouter where Stop is used to store stoppi...
std::string busstop
(Optional) bus stop if one is assigned to the stop
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
T get(const std::string &str) const
static MMVersion toVersion(const std::string &sData)
parse a (network) version string