 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
53 myEdgeBuilder(eb), myIgnoreInternal(ignoreInternal),
54 myCurrentName(), myCurrentEdge(nullptr), myCurrentStoppingPlace(nullptr),
55 myMinorPenalty(minorPenalty)
191 if (fromNode ==
nullptr) {
193 fromNode =
new RONode(from);
197 if (toNode ==
nullptr) {
238 if (shape.size() < 2) {
239 WRITE_ERROR(
"Ignoring lane '" +
id +
"' with broken shape.");
245 if (permissions !=
SVCAll) {
249 if (maxSpeed > 0 && length > 0 &&
id.length() > 0) {
293 if (from ==
nullptr) {
294 throw ProcessError(
"unknown from-edge '" + fromID +
"' in connection");
297 throw ProcessError(
"unknown to-edge '" + toID +
"' in connection");
299 if ((
int)from->getLanes().size() <= fromLane) {
300 throw ProcessError(
"invalid fromLane '" +
toString(fromLane) +
"' in connection from '" + fromID +
"'.");
302 if ((
int)to->
getLanes().size() <= toLane) {
303 throw ProcessError(
"invalid toLane '" +
toString(toLane) +
"' in connection to '" + toID +
"'.");
306 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane]);
307 from->addSuccessor(to,
nullptr, dir);
310 if (via ==
nullptr) {
311 throw ProcessError(
"unknown via-edge '" + viaID +
"' in connection");
313 from->getLanes()[fromLane]->addOutgoingLane(to->
getLanes()[toLane], via);
314 from->addSuccessor(to, via, dir);
336 if (edge ==
nullptr) {
357 if (edge ==
nullptr) {
361 WRITE_WARNING(
"Ignoring invalid access from non-pedestrian edge '" + edge->getID() +
"'.");
388 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
A train stop (alias for bus stop)
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const double myMinorPenalty
time penalty for passing a minor link
This is an uncontrolled, right-before-left link.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
#define WRITE_WARNING(msg)
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
static StringBijection< LinkState > LinkStates
link states
bool addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource)
RONode * getNode(const std::string &id) const
Retrieves an node from the network.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
SAX-handler base for SUMO-files.
std::string lane
The lane to stop at.
virtual void myEndElement(int element)
Called when a closing tag occurs.
void setTimePenalty(double value)
void parseAccess(const SUMOSAXAttributes &attrs)
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
parameter associated to a certain key
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
a source within a district (connection road)
std::string busstop
(Optional) bus stop if one is assigned to the stop
void addNode(RONode *node)
virtual bool addEdge(ROEdge *edge)
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal, const double minorPenalty)
Constructor.
void parseConnection(const SUMOSAXAttributes &attrs)
begin/end of the description of a single lane
void addParam(const SUMOSAXAttributes &attrs)
assign arbitrary vehicle parameters
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
A single lane the router may use.
The router's network representation.
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
The abstract direction of a link.
SumoXMLTag
Numbers representing SUMO-XML - element names.
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
void addStoppingPlace(const std::string &id, const SumoXMLTag category, SUMOVehicleParameter::Stop *stop)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
std::string myCurrentName
The name of the edge/node that is currently processed.
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
T get(const std::string &str) const
void setRestrictions(const std::map< SUMOVehicleClass, double > *restrictions)
Sets the vehicle class specific speed limits of the edge.
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished
A class that stores a 2D geometrical boundary.
begin/end of the description of an edge
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
const bool myIgnoreInternal
whether to ignore junction internal edges
A point in 2D or 3D with translation and scaling methods.
double endPos
The stopping position end.
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.
This is an uncontrolled, minor link, has to brake.
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
virtual ~RONetHandler()
Destructor.
double startPos
The stopping position start.
begin/end of the description of an edge restriction
void addOutgoing(ROEdge *edge)
a traffic assignment zone
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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...
a sink within a district (connection road)
ROEdge * myCurrentEdge
The currently built edge.
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
double getLength() const
Returns the length of the edge.
void setPosition(const Position &p)
Sets the position of the node.
root element of a network file
const SVCPermissions SVCAll
all VClasses are allowed
bool addDistrict(const std::string id, ROEdge *source, ROEdge *sink)
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
void setPermissionsFound()
connectio between two lanes
void addIncoming(ROEdge *edge)
A basic edge for routing applications.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
This is an uncontrolled, all-way stop link.
virtual ROEdge * buildEdge(const std::string &name, RONode *from, RONode *to, const int priority)=0
Builds an edge with the given name.
void parseDistrict(const SUMOSAXAttributes &attrs)
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
An access point for a train stop.
std::string myCurrentTypeID
The id of the currently processed edge type.
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 parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
Base class for nodes used by the router.
void setFunction(SumoXMLEdgeFunc func)
Sets the function of the edge.
Encapsulated SAX-Attributes.
ROEdge * getEdgeForLaneID(const std::string &laneID) const
Retrieves an edge from the network when the lane id is given.
edge: the shape in xml-definition
Interface for building instances of router-edges.
RONet & myNet
The net to store the information into.
Definition of vehicle stop (position and duration)
begin/end of the description of a junction
double myNetworkVersion
the loaded network version
This is an uncontrolled, minor link, has to stop.