52 #ifdef CHECK_MEMORY_LEAKS 54 #endif // CHECK_MEMORY_LEAKS 99 if (!oc.
isSet(
"matsim-files")) {
107 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
110 WRITE_ERROR(
"Could not open matsim-file '" + *file +
"'.");
113 nodesHandler.setFileName(*file);
123 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
139 "matsim - file"), myNodeCont(toFill) {
161 WRITE_ERROR(
"Unable to project coordinates for node '" +
id +
"'.");
166 WRITE_ERROR(
"Could not add node '" +
id +
"'. Probably declared twice.");
176 bool keepEdgeLengths,
bool lanesFromCapacity,
180 myNodeCont(nc), myEdgeCont(toFill), myCapacityNorm(3600),
181 myKeepEdgeLengths(keepEdgeLengths), myLanesFromCapacity(lanesFromCapacity),
182 myCapacity2Lanes(capacity2Lanes) {
206 if (st.size() != 3) {
207 WRITE_ERROR(
"Bogus capacity period format; requires 'hh:mm:ss'.");
238 WRITE_ERROR(
"Could not find from-node for edge '" +
id +
"'.");
241 WRITE_ERROR(
"Could not find to-node for edge '" +
id +
"'.");
243 if (fromNode == 0 || toNode == 0) {
256 WRITE_ERROR(
"Could not add edge '" +
id +
"'. Probably declared twice.");
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
int get(SUMOReal capacity) const
Returns the number of lanes computed from the given capacity.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
static bool isReadable(std::string path)
Checks whether the given file is readable.
A helper class which computes the lane number from given capacity.
The representation of a single edge during network building.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
NodesHandler(NBNodeCont &toFill)
Contructor.
NBNodeCont & myNodeCont
The nodes container to fill.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
A handler which converts occuring elements and attributes into enums.
void setFileName(const std::string &name)
Sets the current file name.
bool myLanesFromCapacity
Whether the lane number shall be computed from the capacity.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
static StringBijection< int >::Entry matsimAttrs[]
The names of MATSIM-XML attributes (for passing to GenericSAXHandler)
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.
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
Returns the edge container.
SUMOReal myCapacityNorm
The capacity norming.
~NodesHandler()
Destructor.
A class which extracts MATSIM-nodes from a parsed MATSIM-file.
Storage for edges, including some functionality operating on multiple edges.
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
#define PROGRESS_BEGIN_MESSAGE(msg)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void setLoadedLength(SUMOReal val)
set loaded lenght
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool myKeepEdgeLengths
Whether the loaded lengths shal be used.
EdgesHandler(const NBNodeCont &nc, NBEdgeCont &toFill, bool keepEdgeLengths, bool lanesFromCapacity, NBCapacity2Lanes capacity2Lanes)
Constructor.
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
NBCapacity2Lanes myCapacity2Lanes
The converter from flow to lanes.
~EdgesHandler()
Destructor.
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
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.
A class which extracts MATSIM-edges from a parsed MATSIM-file.
const NBNodeCont & myNodeCont
The previously parsed nodes.
NBNodeCont & getNodeCont()
Returns the node container.
Instance responsible for building networks.
A storage for options typed value containers)
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given MATSIM network files.
Represents a single node (junction) during network building.
Container for nodes during the netbuilding process.
static StringBijection< int >::Entry matsimTags[]
The names of MATSIM-XML elements (for passing to GenericSAXHandler)
#define PROGRESS_DONE_MESSAGE()
NBEdgeCont & myEdgeCont
The edge container to fill.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)