92 const std::vector<std::string> files = oc.
getStringVector(
"matsim-files");
95 for (
const std::string& file : files) {
106 for (
const std::string& file : files) {
143 WRITE_ERRORF(
TL(
"Unable to project coordinates for node '%'."),
id);
148 WRITE_ERRORF(
TL(
"Could not add node '%'. Probably declared twice."),
id);
158 bool keepEdgeLengths,
bool lanesFromCapacity,
174 NBEdge* edge =
new NBEdge(
id, fromNode, toNode,
"", freeSpeed,
NBEdge::UNSPECIFIED_FRICTION, numLanes, -1,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_OFFSET,
LaneSpreadFunction::RIGHT);
182 WRITE_ERRORF(
TL(
"Could not add edge '%'. Probably declared twice."),
id);
190 if (modes.size() == 0) {
195 std::string mode = st.next();
198 }
else if (mode ==
"bike") {
200 }
else if (mode ==
"motorcycle") {
202 }
else if (mode ==
"truck") {
204 }
else if (mode ==
"pt") {
206 }
else if (mode ==
"drt" || mode ==
"taxi") {
208 }
else if (mode ==
"walk" || mode ==
"transit_walk") {
210 }
else if (mode ==
"train") {
212 }
else if (mode ==
"ship") {
236 if (st.size() != 3) {
237 WRITE_ERROR(
TL(
"Bogus capacity period format; requires 'hh:mm:ss'."));
268 if (fromNode ==
nullptr) {
271 if (toNode ==
nullptr) {
274 if (fromNode ==
nullptr || toNode ==
nullptr) {
280 if (permLanes < 0.5) {
284 if (fromNode == toNode) {
289 toNode = intermediate;
292 WRITE_ERRORF(
TL(
"Could not add intermediate node to split loop edge '%'."),
id);
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
const SVCPermissions SVCAll
all VClasses are allowed
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_SHIP
is an arbitrary ship
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_MOPED
vehicle is a moped
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GenericSAXHandler(SequentialStringBijection::Entry *tags, int terminatorTag, SequentialStringBijection::Entry *attrs, int terminatorAttr, const std::string &file, const std::string &expectedRoot="")
Constructor.
void setFileName(const std::string &name)
Sets the current file name.
A helper class which computes the lane number from given capacity.
Storage for edges, including some functionality operating on multiple edges.
The representation of a single edge during network building.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
static const double UNSPECIFIED_FRICTION
unspecified lane friction
static const double UNSPECIFIED_WIDTH
unspecified lane width
static const double UNSPECIFIED_OFFSET
unspecified lane offset
void setLoadedLength(double val)
set loaded length
Instance responsible for building networks.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
NBEdgeCont & getEdgeCont()
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
Container for nodes during the netbuilding process.
Represents a single node (junction) during network building.
const Position & getPosition() const
A class which extracts MATSIM-edges from a parsed MATSIM-file.
double myCapacityNorm
The capacity norming.
SVCPermissions computePermission(std::string modes)
~EdgesHandler()
Destructor.
NBCapacity2Lanes myCapacity2Lanes
The converter from flow to lanes.
bool myKeepEdgeLengths
Whether the loaded lengths shal be used.
bool myLanesFromCapacity
Whether the lane number shall be computed from the capacity.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
EdgesHandler(NBNodeCont &nc, NBEdgeCont &toFill, bool keepEdgeLengths, bool lanesFromCapacity, NBCapacity2Lanes capacity2Lanes)
Constructor.
NBNodeCont & myNodeCont
The previously parsed nodes.
void insertEdge(const std::string &id, NBNode *fromNode, NBNode *toNode, double freeSpeed, int numLanes, double capacity, double length, SVCPermissions perm=SVCAll)
NBEdgeCont & myEdgeCont
The edge container to fill.
A class which extracts MATSIM-nodes from a parsed MATSIM-file.
NodesHandler(NBNodeCont &toFill)
Contructor.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
NBNodeCont & myNodeCont
The nodes container to fill.
~NodesHandler()
Destructor.
static SequentialStringBijection::Entry matsimAttrs[]
The names of MATSIM-XML attributes (for passing to GenericSAXHandler).
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given MATSIM network files.
static SequentialStringBijection::Entry matsimTags[]
The names of MATSIM-XML elements (for passing to GenericSAXHandler).
A storage for options typed value containers).
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float).
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool).
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector).
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file).
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.
Encapsulated SAX-Attributes.
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.
static std::string makeValidID(const std::string &value)
transform the given string into a valid id for a network element (or any other id)
bool hasNext()
returns the information whether further substrings exist
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.