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 /****************************************************************************/
15 // Importer for networks stored in MATSim format
16 /****************************************************************************/
17 #ifndef NIImporter_MATSim_h
18 #define NIImporter_MATSim_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class NBEdge;
37 class NBEdgeCont;
38 class NBNetBuilder;
39 class NBNode;
40 class NBNodeCont;
42 class NBTypeCont;
43 class OptionsCont;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
55 public:
67  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
68 
69 
70 private:
76  public:
80  NodesHandler(NBNodeCont& toFill);
81 
82 
84  ~NodesHandler();
85 
86 
87  protected:
89 
90 
98  void myStartElement(int element, const SUMOSAXAttributes& attrs);
100 
101 
102  private:
105 
106 
107  private:
109  NodesHandler(const NodesHandler& s);
110 
113 
114  };
115 
116 
117 
123  public:
132  EdgesHandler(const NBNodeCont& nc, NBEdgeCont& toFill,
133  bool keepEdgeLengths, bool lanesFromCapacity,
134  NBCapacity2Lanes capacity2Lanes);
135 
136 
138  ~EdgesHandler();
139 
140 
141  protected:
143 
144 
152  void myStartElement(int element, const SUMOSAXAttributes& attrs);
154 
155 
156  private:
159 
162 
165 
168 
171 
174 
175 
176  private:
178  EdgesHandler(const EdgesHandler& s);
179 
182 
183  };
184 
185 
197  };
198 
199 
221  };
222 
225 
228 
229 
230 };
231 
232 
233 #endif
234 
235 /****************************************************************************/
236 
NIImporter_MATSim::EdgesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIImporter_MATSim.cpp:179
NIImporter_MATSim::MATSIM_ATTR_CAPACITY
@ MATSIM_ATTR_CAPACITY
Definition: NIImporter_MATSim.h:214
NIImporter_MATSim::MatsimXMLAttr
MatsimXMLAttr
Numbers representing MATSIM-XML - attributes.
Definition: NIImporter_MATSim.h:205
NIImporter_MATSim::MATSIM_TAG_NOTHING
@ MATSIM_TAG_NOTHING
Definition: NIImporter_MATSim.h:192
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
NIImporter_MATSim::EdgesHandler::myLanesFromCapacity
bool myLanesFromCapacity
Whether the lane number shall be computed from the capacity.
Definition: NIImporter_MATSim.h:170
NIImporter_MATSim::MATSIM_ATTR_Y
@ MATSIM_ATTR_Y
Definition: NIImporter_MATSim.h:209
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
NIImporter_MATSim::EdgesHandler::myKeepEdgeLengths
bool myKeepEdgeLengths
Whether the loaded lengths shal be used.
Definition: NIImporter_MATSim.h:167
NIImporter_MATSim::EdgesHandler::myCapacity2Lanes
NBCapacity2Lanes myCapacity2Lanes
The converter from flow to lanes.
Definition: NIImporter_MATSim.h:173
NIImporter_MATSim::NodesHandler::NodesHandler
NodesHandler(NBNodeCont &toFill)
Contructor.
Definition: NIImporter_MATSim.cpp:124
NIImporter_MATSim::NodesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIImporter_MATSim.cpp:135
NIImporter_MATSim::matsimAttrs
static StringBijection< int >::Entry matsimAttrs[]
The names of MATSIM-XML attributes (for passing to GenericSAXHandler)
Definition: NIImporter_MATSim.h:227
SUMOSAXHandler.h
NIImporter_MATSim::MATSIM_ATTR_PERMLANES
@ MATSIM_ATTR_PERMLANES
Definition: NIImporter_MATSim.h:215
NIImporter_MATSim::MATSIM_ATTR_CAPPERIOD
@ MATSIM_ATTR_CAPPERIOD
Definition: NIImporter_MATSim.h:219
NIImporter_MATSim::loadNetwork
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given MATSIM network files.
Definition: NIImporter_MATSim.cpp:85
NIImporter_MATSim::MATSIM_ATTR_TO
@ MATSIM_ATTR_TO
Definition: NIImporter_MATSim.h:211
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NIImporter_MATSim::EdgesHandler::myCapacityNorm
double myCapacityNorm
The capacity norming.
Definition: NIImporter_MATSim.h:164
NIImporter_MATSim::MatsimXMLTag
MatsimXMLTag
Numbers representing MATSIM-XML - element names.
Definition: NIImporter_MATSim.h:191
NIImporter_MATSim::MATSIM_TAG_LINKS
@ MATSIM_TAG_LINKS
Definition: NIImporter_MATSim.h:196
NIImporter_MATSim::EdgesHandler::operator=
EdgesHandler & operator=(const EdgesHandler &s)
invalidated assignment operator
NIImporter_MATSim::MATSIM_ATTR_MODES
@ MATSIM_ATTR_MODES
Definition: NIImporter_MATSim.h:217
NIImporter_MATSim::EdgesHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The edge container to fill.
Definition: NIImporter_MATSim.h:161
StringBijection
Definition: StringBijection.h:43
NIImporter_MATSim::MATSIM_ATTR_NOTHING
@ MATSIM_ATTR_NOTHING
Definition: NIImporter_MATSim.h:206
NIImporter_MATSim::matsimTags
static StringBijection< int >::Entry matsimTags[]
The names of MATSIM-XML elements (for passing to GenericSAXHandler)
Definition: NIImporter_MATSim.h:224
NIImporter_MATSim::MATSIM_ATTR_LENGTH
@ MATSIM_ATTR_LENGTH
Definition: NIImporter_MATSim.h:212
NIImporter_MATSim::MATSIM_TAG_NODE
@ MATSIM_TAG_NODE
Definition: NIImporter_MATSim.h:194
NIImporter_MATSim::MATSIM_ATTR_ORIGID
@ MATSIM_ATTR_ORIGID
Definition: NIImporter_MATSim.h:218
NIImporter_MATSim::MATSIM_TAG_LINK
@ MATSIM_TAG_LINK
Definition: NIImporter_MATSim.h:195
NIImporter_MATSim::EdgesHandler::myNodeCont
const NBNodeCont & myNodeCont
The previously parsed nodes.
Definition: NIImporter_MATSim.h:158
NBCapacity2Lanes.h
UtilExceptions.h
NIImporter_MATSim::NodesHandler::~NodesHandler
~NodesHandler()
Destructor.
Definition: NIImporter_MATSim.cpp:131
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NIImporter_MATSim
Importer for networks stored in MATSim format.
Definition: NIImporter_MATSim.h:54
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:39
NIImporter_MATSim::MATSIM_ATTR_FREESPEED
@ MATSIM_ATTR_FREESPEED
Definition: NIImporter_MATSim.h:213
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:54
NIImporter_MATSim::NodesHandler::myNodeCont
NBNodeCont & myNodeCont
The nodes container to fill.
Definition: NIImporter_MATSim.h:104
NIImporter_MATSim::EdgesHandler::~EdgesHandler
~EdgesHandler()
Destructor.
Definition: NIImporter_MATSim.cpp:174
NIImporter_MATSim::NodesHandler
A class which extracts MATSIM-nodes from a parsed MATSIM-file.
Definition: NIImporter_MATSim.h:75
NIImporter_MATSim::MATSIM_ATTR_CAPDIVIDER
@ MATSIM_ATTR_CAPDIVIDER
Definition: NIImporter_MATSim.h:220
config.h
NIImporter_MATSim::MATSIM_ATTR_FROM
@ MATSIM_ATTR_FROM
Definition: NIImporter_MATSim.h:210
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
NIImporter_MATSim::EdgesHandler::EdgesHandler
EdgesHandler(const NBNodeCont &nc, NBEdgeCont &toFill, bool keepEdgeLengths, bool lanesFromCapacity, NBCapacity2Lanes capacity2Lanes)
Constructor.
Definition: NIImporter_MATSim.cpp:163
NIImporter_MATSim::EdgesHandler
A class which extracts MATSIM-edges from a parsed MATSIM-file.
Definition: NIImporter_MATSim.h:122
NIImporter_MATSim::MATSIM_ATTR_X
@ MATSIM_ATTR_X
Definition: NIImporter_MATSim.h:208
GenericSAXHandler
A handler which converts occuring elements and attributes into enums.
Definition: GenericSAXHandler.h:67
NIImporter_MATSim::MATSIM_TAG_NETWORK
@ MATSIM_TAG_NETWORK
Definition: NIImporter_MATSim.h:193
NIImporter_MATSim::MATSIM_ATTR_ONEWAY
@ MATSIM_ATTR_ONEWAY
Definition: NIImporter_MATSim.h:216
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
NIImporter_MATSim::MATSIM_ATTR_ID
@ MATSIM_ATTR_ID
Definition: NIImporter_MATSim.h:207