SUMO - Simulation of Urban MObility
NIImporter_MATSim.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Importer for networks stored in MATSim format
17 /****************************************************************************/
18 #ifndef NIImporter_MATSim_h
19 #define NIImporter_MATSim_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class NBEdge;
38 class NBEdgeCont;
39 class NBNetBuilder;
40 class NBNode;
41 class NBNodeCont;
43 class NBTypeCont;
44 class OptionsCont;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
56 public:
68  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
69 
70 
71 private:
77  public:
81  NodesHandler(NBNodeCont& toFill);
82 
83 
85  ~NodesHandler();
86 
87 
88  protected:
90 
91 
99  void myStartElement(int element, const SUMOSAXAttributes& attrs);
101 
102 
103  private:
106 
107 
108  private:
110  NodesHandler(const NodesHandler& s);
111 
114 
115  };
116 
117 
118 
124  public:
133  EdgesHandler(const NBNodeCont& nc, NBEdgeCont& toFill,
134  bool keepEdgeLengths, bool lanesFromCapacity,
135  NBCapacity2Lanes capacity2Lanes);
136 
137 
139  ~EdgesHandler();
140 
141 
142  protected:
144 
145 
153  void myStartElement(int element, const SUMOSAXAttributes& attrs);
155 
156 
157  private:
160 
163 
166 
169 
172 
175 
176 
177  private:
179  EdgesHandler(const EdgesHandler& s);
180 
183 
184  };
185 
186 
198  };
199 
200 
222  };
223 
226 
229 
230 
231 };
232 
233 
234 #endif
235 
236 /****************************************************************************/
237 
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
A container for traffic light definitions and built programs.
A helper class which computes the lane number from given capacity.
The representation of a single edge during network building.
Definition: NBEdge.h:65
NodesHandler(NBNodeCont &toFill)
Contructor.
NBNodeCont & myNodeCont
The nodes container to fill.
A handler which converts occuring elements and attributes into enums.
bool myLanesFromCapacity
Whether the lane number shall be computed from the capacity.
static StringBijection< int >::Entry matsimAttrs[]
The names of MATSIM-XML attributes (for passing to GenericSAXHandler)
Encapsulated SAX-Attributes.
MatsimXMLAttr
Numbers representing MATSIM-XML - attributes.
A class which extracts MATSIM-nodes from a parsed MATSIM-file.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
bool myKeepEdgeLengths
Whether the loaded lengths shal be used.
Importer for networks stored in MATSim format.
double myCapacityNorm
The capacity norming.
MatsimXMLTag
Numbers representing MATSIM-XML - element names.
NBCapacity2Lanes myCapacity2Lanes
The converter from flow to lanes.
A class which extracts MATSIM-edges from a parsed MATSIM-file.
const NBNodeCont & myNodeCont
The previously parsed nodes.
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
A storage for options typed value containers)
Definition: OptionsCont.h:92
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.
Definition: NBNode.h:68
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
static StringBijection< int >::Entry matsimTags[]
The names of MATSIM-XML elements (for passing to GenericSAXHandler)
NodesHandler & operator=(const NodesHandler &s)
invalidated assignment operator
NBEdgeCont & myEdgeCont
The edge container to fill.
A storage for available types of edges.
Definition: NBTypeCont.h:55