SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NIImporter_ITSUMO.h
Go to the documentation of this file.
1
/****************************************************************************/
7
// Importer for networks stored in ITSUMO format
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
11
/****************************************************************************/
12
//
13
// This file is part of SUMO.
14
// SUMO is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
/****************************************************************************/
20
#ifndef NIImporter_ITSUMO_h
21
#define NIImporter_ITSUMO_h
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
#include <string>
34
#include <map>
35
#include <
netbuild/NBCapacity2Lanes.h
>
36
#include <
utils/xml/SUMOSAXHandler.h
>
37
#include <
utils/common/UtilExceptions.h
>
38
39
40
// ===========================================================================
41
// class declarations
42
// ===========================================================================
43
class
NBEdge
;
44
class
NBEdgeCont
;
45
class
NBNetBuilder
;
46
class
NBNode
;
47
class
NBNodeCont
;
48
class
NBTrafficLightLogicCont
;
49
class
NBTypeCont
;
50
class
OptionsCont
;
51
52
53
// ===========================================================================
54
// class definitions
55
// ===========================================================================
61
class
NIImporter_ITSUMO
{
62
public
:
74
static
void
loadNetwork
(
const
OptionsCont
& oc,
NBNetBuilder
& nb);
75
76
77
private
:
82
class
Handler
:
public
GenericSAXHandler
{
83
public
:
87
Handler
(
NBNetBuilder
& toFill) ;
88
89
91
~Handler
() ;
92
93
94
protected
:
96
97
105
void
myStartElement
(
int
element,
const
SUMOSAXAttributes
& attrs) ;
106
107
116
void
myCharacters
(
int
element,
const
std::string& chars);
117
118
125
void
myEndElement
(
int
element);
127
128
129
private
:
131
NBNetBuilder
&
myNetBuilder
;
132
134
std::map<std::string, std::string>
myParameter
;
135
136
137
struct
Lane
{
138
public
:
139
Lane
(
const
std::string&
id
,
unsigned
int
idx,
SUMOReal
v)
140
:
myID
(id),
myIndex
(idx),
myV
(v) {}
141
std::string
myID
;
142
unsigned
int
myIndex
;
143
SUMOReal
myV
;
144
};
145
146
std::vector<Lane>
myCurrentLanes
;
147
148
struct
LaneSet
{
149
public
:
150
LaneSet
(
const
std::string&
id
,
const
std::vector<Lane> &lanes,
SUMOReal
v,
int
pos,
NBNode
* from,
NBNode
* to)
151
:
myID
(id),
myLanes
(lanes),
myV
(v),
myPosition
(pos),
myFrom
(from),
myTo
(to) {}
152
std::string
myID
;
153
std::vector<Lane>
myLanes
;
154
SUMOReal
myV
;
155
int
myPosition
;
156
NBNode
*
myFrom
;
157
NBNode
*
myTo
;
158
};
159
160
std::map<std::string, LaneSet*>
myLaneSets
;
161
std::vector<LaneSet*>
myCurrentLaneSets
;
162
163
struct
Section
{
164
public
:
165
Section
(
const
std::string&
id
,
const
std::vector<LaneSet*> &laneSets)
166
:
myID
(id),
myLaneSets
(laneSets) {}
167
std::string
myID
;
168
std::vector<LaneSet*>
myLaneSets
;
169
};
170
171
std::vector<Section*>
mySections
;
172
173
174
private
:
176
Handler
(
const
Handler
& s);
177
179
Handler
&
operator=
(
const
Handler
& s);
180
181
};
182
183
184
190
enum
ItsumoXMLTag
{
191
ITSUMO_TAG_NOTHING
= 0,
192
ITSUMO_TAG_SIMULATION
,
193
ITSUMO_TAG_NETWORK_ID
,
194
ITSUMO_TAG_NETWORK_NAME
,
195
ITSUMO_TAG_NODES
,
196
ITSUMO_TAG_NODE
,
197
ITSUMO_TAG_NODE_ID
,
198
ITSUMO_TAG_NODE_NAME
,
199
ITSUMO_TAG_X_COORD
,
200
ITSUMO_TAG_Y_COORD
,
201
ITSUMO_TAG_SOURCES
,
202
ITSUMO_TAG_SINKS
,
203
ITSUMO_TAG_TRAFFIC_LIGHTS
,
204
ITSUMO_TAG_STREETS
,
205
ITSUMO_TAG_STREET
,
206
ITSUMO_TAG_STREET_ID
,
207
ITSUMO_TAG_STREET_NAME
,
208
ITSUMO_TAG_SECTIONS
,
209
ITSUMO_TAG_SECTION
,
210
ITSUMO_TAG_SECTION_ID
,
211
ITSUMO_TAG_SECTION_NAME
,
212
ITSUMO_TAG_IS_PREFERENCIAL
,
213
ITSUMO_TAG_DELIMITING_NODE
,
214
ITSUMO_TAG_LANESETS
,
215
ITSUMO_TAG_LANESET
,
216
ITSUMO_TAG_LANESET_ID
,
217
ITSUMO_TAG_LANESET_POSITION
,
218
ITSUMO_TAG_START_NODE
,
219
ITSUMO_TAG_END_NODE
,
220
ITSUMO_TAG_TURNING_PROBABILITIES
,
221
ITSUMO_TAG_DIRECTION
,
222
ITSUMO_TAG_DESTINATION_LANESET
,
223
ITSUMO_TAG_PROBABILITY
,
224
ITSUMO_TAG_LANES
,
225
ITSUMO_TAG_LANE
,
226
ITSUMO_TAG_LANE_ID
,
227
ITSUMO_TAG_LANE_POSITION
,
228
ITSUMO_TAG_MAXIMUM_SPEED
,
229
ITSUMO_TAG_DECELERATION_PROB
230
};
231
232
238
enum
ItsumoXMLAttr
{
239
ITSUMO_ATTR_NOTHING
= 0
240
};
241
243
static
StringBijection<int>::Entry
itsumoTags
[];
244
246
static
StringBijection<int>::Entry
itsumoAttrs
[];
247
248
249
};
250
251
252
#endif
253
254
/****************************************************************************/
255
var
build
temp
tmp.znCyBrHNjL
4.0-0-0
sumo
sumo-0.15.0~dfsg
src
netimport
NIImporter_ITSUMO.h
Generated on Mon Mar 24 2014 09:53:12 for SUMO - Simulation of Urban MObility by
1.8.1.2