57 myNet(net), myCurrentName(),
58 myCurrentEdge(0), myCurrentStoppingPlace(0),
172 fromNode =
new RONode(from);
219 if (permissions !=
SVCAll) {
223 if (maxSpeed > 0 && length > 0 &&
id.length() > 0) {
268 throw ProcessError(
"unknown from-edge '" + fromID +
"' in connection");
271 throw ProcessError(
"unknown to-edge '" + toID +
"' in connection");
273 if ((
int)from->getLanes().size() <= fromLane) {
274 throw ProcessError(
"invalid fromLane '" +
toString(fromLane) +
"' in connection from '" + fromID +
"'.");
276 if ((
int)to->
getLanes().size() <= toLane) {
277 throw ProcessError(
"invalid toLane '" +
toString(toLane) +
"' in connection to '" + toID +
"'.");
279 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane]);
280 from->addSuccessor(to, dir);
284 throw ProcessError(
"unknown via-edge '" + viaID +
"' in connection");
286 from->addSuccessor(via, dir);
349 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
RONode * getNode(const std::string &id) const
Retrieves an node from the network.
bool addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource)
std::string myCurrentName
The name of the edge/node that is currently processed.
void addOutgoing(ROEdge *edge)
SumoXMLTag
Numbers representing SUMO-XML - element names.
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
a source within a district (connection road)
ROEdge * getEdgeForLaneID(const std::string &laneID) const
Retrieves an edge from the network when the lane id is given.
A single lane the router may use.
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
root element of a network file
begin/end of the description of a junction
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void parseDistrict(const SUMOSAXAttributes &attrs)
a traffic assignment zone
void addNode(RONode *node)
connectio between two lanes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
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.
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
double getLength() const
Returns the length of the edge.
const SVCPermissions SVCAll
all VClasses are allowed
begin/end of the description of an edge restriction
SAX-handler base for SUMO-files.
Interface for building instances of router-edges.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished ...
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
#define WRITE_WARNING(msg)
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb)
Constructor.
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double startPos
The stopping position start.
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
std::multimap< std::string, double > accessPos
lanes and positions connected to this stop
A point in 2D or 3D with translation and scaling methods.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
double endPos
The stopping position end.
void setPosition(const Position &p)
Sets the position of the node.
virtual ~RONetHandler()
Destructor.
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
void addIncoming(ROEdge *edge)
A basic edge for routing applications.
begin/end of the description of an edge
std::string lane
The lane to stop at.
virtual std::vector< std::string > getStringVector(int attr) const =0
Tries to read given attribute assuming it is a string vector.
virtual ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)=0
Builds an edge with the given name.
static bool checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
The router's network representation.
bool addDistrict(const std::string id, ROEdge *source, ROEdge *sink)
A train stop (alias for bus stop)
void addStoppingPlace(const std::string &id, const SumoXMLTag category, SUMOVehicleParameter::Stop *stop)
a sink within a district (connection road)
Definition of vehicle stop (position and duration)
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
The abstract direction of a link.
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
virtual bool addEdge(ROEdge *edge)
RONet & myNet
The net to store the information into.
void parseConnection(const SUMOSAXAttributes &attrs)
virtual void myEndElement(int element)
Called when a closing tag occurs.
Base class for nodes used by the router.
std::string myCurrentTypeID
The id of the currently processed edge type.
void parseAccess(const SUMOSAXAttributes &attrs)
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
void setRestrictions(const std::map< SUMOVehicleClass, double > *restrictions)
Sets the vehicle class specific speed limits of the edge.
An access point for a train stop.
ROEdge * myCurrentEdge
The currently built edge.
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
void setPermissionsFound()
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
void setFunction(SumoXMLEdgeFunc func)
Sets the function of the edge.