Eclipse 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-2019 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 
NIImporter_MATSim::EdgesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIImporter_MATSim.cpp:180
NIImporter_MATSim::MATSIM_ATTR_CAPACITY
Definition: NIImporter_MATSim.h:215
NIImporter_MATSim::MatsimXMLAttr
MatsimXMLAttr
Numbers representing MATSIM-XML - attributes.
Definition: NIImporter_MATSim.h:206
NIImporter_MATSim::MATSIM_TAG_NOTHING
Definition: NIImporter_MATSim.h:193
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:110
NIImporter_MATSim::EdgesHandler::myLanesFromCapacity
bool myLanesFromCapacity
Whether the lane number shall be computed from the capacity.
Definition: NIImporter_MATSim.h:171
NIImporter_MATSim::MATSIM_ATTR_Y
Definition: NIImporter_MATSim.h:210
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:58
NIImporter_MATSim::EdgesHandler::myKeepEdgeLengths
bool myKeepEdgeLengths
Whether the loaded lengths shal be used.
Definition: NIImporter_MATSim.h:168
NIImporter_MATSim::EdgesHandler::myCapacity2Lanes
NBCapacity2Lanes myCapacity2Lanes
The converter from flow to lanes.
Definition: NIImporter_MATSim.h:174
NIImporter_MATSim::NodesHandler::NodesHandler
NodesHandler(NBNodeCont &toFill)
Contructor.
Definition: NIImporter_MATSim.cpp:125
NIImporter_MATSim::NodesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIImporter_MATSim.cpp:136
NIImporter_MATSim::matsimAttrs
static StringBijection< int >::Entry matsimAttrs[]
The names of MATSIM-XML attributes (for passing to GenericSAXHandler)
Definition: NIImporter_MATSim.h:228
SUMOSAXHandler.h
NIImporter_MATSim::MATSIM_ATTR_PERMLANES
Definition: NIImporter_MATSim.h:216
NIImporter_MATSim::MATSIM_ATTR_CAPPERIOD
Definition: NIImporter_MATSim.h:220
NIImporter_MATSim::loadNetwork
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given MATSIM network files.
Definition: NIImporter_MATSim.cpp:86
NIImporter_MATSim::MATSIM_ATTR_TO
Definition: NIImporter_MATSim.h:212
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
NIImporter_MATSim::EdgesHandler::myCapacityNorm
double myCapacityNorm
The capacity norming.
Definition: NIImporter_MATSim.h:165
NIImporter_MATSim::MatsimXMLTag
MatsimXMLTag
Numbers representing MATSIM-XML - element names.
Definition: NIImporter_MATSim.h:192
NIImporter_MATSim::MATSIM_TAG_LINKS
Definition: NIImporter_MATSim.h:197
NIImporter_MATSim::EdgesHandler::operator=
EdgesHandler & operator=(const EdgesHandler &s)
invalidated assignment operator
NIImporter_MATSim::MATSIM_ATTR_MODES
Definition: NIImporter_MATSim.h:218
NIImporter_MATSim::EdgesHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The edge container to fill.
Definition: NIImporter_MATSim.h:162
StringBijection
Definition: StringBijection.h:44
NIImporter_MATSim::MATSIM_ATTR_NOTHING
Definition: NIImporter_MATSim.h:207
NIImporter_MATSim::matsimTags
static StringBijection< int >::Entry matsimTags[]
The names of MATSIM-XML elements (for passing to GenericSAXHandler)
Definition: NIImporter_MATSim.h:225
NIImporter_MATSim::MATSIM_ATTR_LENGTH
Definition: NIImporter_MATSim.h:213
NIImporter_MATSim::MATSIM_TAG_NODE
Definition: NIImporter_MATSim.h:195
NIImporter_MATSim::MATSIM_ATTR_ORIGID
Definition: NIImporter_MATSim.h:219
NIImporter_MATSim::MATSIM_TAG_LINK
Definition: NIImporter_MATSim.h:196
NIImporter_MATSim::EdgesHandler::myNodeCont
const NBNodeCont & myNodeCont
The previously parsed nodes.
Definition: NIImporter_MATSim.h:159
NBCapacity2Lanes.h
UtilExceptions.h
NIImporter_MATSim::NodesHandler::~NodesHandler
~NodesHandler()
Destructor.
Definition: NIImporter_MATSim.cpp:132
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
NIImporter_MATSim
Importer for networks stored in MATSim format.
Definition: NIImporter_MATSim.h:55
NIImporter_MATSim::NodesHandler::operator=
NodesHandler & operator=(const NodesHandler &s)
invalidated assignment operator
NBCapacity2Lanes
A helper class which computes the lane number from given capacity.
Definition: NBCapacity2Lanes.h:40
NIImporter_MATSim::MATSIM_ATTR_FREESPEED
Definition: NIImporter_MATSim.h:214
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:55
NIImporter_MATSim::NodesHandler::myNodeCont
NBNodeCont & myNodeCont
The nodes container to fill.
Definition: NIImporter_MATSim.h:105
NIImporter_MATSim::EdgesHandler::~EdgesHandler
~EdgesHandler()
Destructor.
Definition: NIImporter_MATSim.cpp:175
NIImporter_MATSim::NodesHandler
A class which extracts MATSIM-nodes from a parsed MATSIM-file.
Definition: NIImporter_MATSim.h:76
NIImporter_MATSim::MATSIM_ATTR_CAPDIVIDER
Definition: NIImporter_MATSim.h:221
config.h
NIImporter_MATSim::MATSIM_ATTR_FROM
Definition: NIImporter_MATSim.h:211
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:68
NIImporter_MATSim::EdgesHandler::EdgesHandler
EdgesHandler(const NBNodeCont &nc, NBEdgeCont &toFill, bool keepEdgeLengths, bool lanesFromCapacity, NBCapacity2Lanes capacity2Lanes)
Constructor.
Definition: NIImporter_MATSim.cpp:164
NIImporter_MATSim::EdgesHandler
A class which extracts MATSIM-edges from a parsed MATSIM-file.
Definition: NIImporter_MATSim.h:123
NIImporter_MATSim::MATSIM_ATTR_X
Definition: NIImporter_MATSim.h:209
GenericSAXHandler
A handler which converts occuring elements and attributes into enums.
Definition: GenericSAXHandler.h:68
NIImporter_MATSim::MATSIM_TAG_NETWORK
Definition: NIImporter_MATSim.h:194
NIImporter_MATSim::MATSIM_ATTR_ONEWAY
Definition: NIImporter_MATSim.h:217
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:57
NIImporter_MATSim::MATSIM_ATTR_ID
Definition: NIImporter_MATSim.h:208