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
NLHandler.h
Go to the documentation of this file.
1
/****************************************************************************/
10
// The XML-Handler for network loading
11
/****************************************************************************/
12
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14
/****************************************************************************/
15
//
16
// This file is part of SUMO.
17
// SUMO is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
/****************************************************************************/
23
#ifndef NLHandler_h
24
#define NLHandler_h
25
26
27
// ===========================================================================
28
// included modules
29
// ===========================================================================
30
#ifdef _MSC_VER
31
#include <
windows_config.h
>
32
#else
33
#include <
config.h
>
34
#endif
35
36
#include <xercesc/sax/HandlerBase.hpp>
37
#include <xercesc/sax/SAXException.hpp>
38
#include <xercesc/sax/AttributeList.hpp>
39
#include <
utils/common/SUMOTime.h
>
40
#include <
utils/common/Parameterised.h
>
41
#include <
utils/xml/SUMOXMLDefinitions.h
>
42
#include <
microsim/MSLink.h
>
43
#include <
microsim/MSRouteHandler.h
>
44
#include <
microsim/traffic_lights/MSSimpleTrafficLightLogic.h
>
45
#include <
microsim/traffic_lights/MSActuatedTrafficLightLogic.h
>
46
#include <
microsim/MSBitSetLogic.h
>
47
#include "
NLBuilder.h
"
48
#include "
NLDiscreteEventBuilder.h
"
49
50
51
// ===========================================================================
52
// class declarations
53
// ===========================================================================
54
class
NLContainer;
55
class
NLDetectorBuilder
;
56
class
NLTriggerBuilder
;
57
class
MSTrafficLightLogic
;
58
59
60
// ===========================================================================
61
// class definitions
62
// ===========================================================================
71
class
NLHandler
:
public
MSRouteHandler
{
72
public
:
74
typedef
std::vector<MSLane*>
LaneVector
;
75
76
public
:
86
NLHandler
(
const
std::string& file,
MSNet
& net,
87
NLDetectorBuilder
& detBuilder,
NLTriggerBuilder
& triggerBuilder,
88
NLEdgeControlBuilder
& edgeBuilder,
89
NLJunctionControlBuilder
& junctionBuilder);
90
91
93
virtual
~NLHandler
();
94
95
bool
haveSeenInternalEdge
()
const
{
96
return
myHaveSeenInternalEdge
;
97
}
98
99
protected
:
101
102
111
virtual
void
myStartElement
(
int
element,
112
const
SUMOSAXAttributes
& attrs);
113
114
122
virtual
void
myEndElement
(
int
element);
124
125
126
protected
:
127
void
addParam
(
const
SUMOSAXAttributes
& attrs);
128
132
virtual
void
addE1Detector
(
const
SUMOSAXAttributes
& attrs);
133
137
virtual
void
addInstantE1Detector
(
const
SUMOSAXAttributes
& attrs);
138
142
virtual
void
addE2Detector
(
const
SUMOSAXAttributes
& attrs);
143
147
void
beginE3Detector
(
const
SUMOSAXAttributes
& attrs);
148
152
void
addE3Entry
(
const
SUMOSAXAttributes
& attrs);
153
157
void
addE3Exit
(
const
SUMOSAXAttributes
& attrs);
158
160
virtual
void
endE3Detector
();
161
165
virtual
void
addVTypeProbeDetector
(
const
SUMOSAXAttributes
& attrs);
166
170
virtual
void
addRouteProbeDetector
(
const
SUMOSAXAttributes
& attrs);
171
176
virtual
void
addEdgeLaneMeanData
(
const
SUMOSAXAttributes
& attrs,
int
objecttype);
177
179
virtual
void
closeEdge
();
180
181
182
protected
:
184
MSNet
&
myNet
;
185
186
187
private
:
189
void
beginEdgeParsing
(
const
SUMOSAXAttributes
& attrs);
190
192
void
addLane
(
const
SUMOSAXAttributes
& attrs);
193
195
void
addPOI
(
const
SUMOSAXAttributes
& attrs);
196
198
void
addPoly
(
const
SUMOSAXAttributes
& attrs);
199
201
void
addRequest
(
const
SUMOSAXAttributes
& attrs);
202
204
void
initJunctionLogic
(
const
SUMOSAXAttributes
& attrs);
205
207
void
initTrafficLightLogic
(
const
SUMOSAXAttributes
& attrs);
208
210
void
addPhase
(
const
SUMOSAXAttributes
& attrs);
211
212
214
virtual
void
openJunction
(
const
SUMOSAXAttributes
& attrs);
215
216
void
parseLanes
(
const
std::string& junctionID,
const
std::string& def, std::vector<MSLane*>& into,
bool
& ok);
217
219
void
addConnection
(
const
SUMOSAXAttributes
& attrs);
220
221
virtual
void
openWAUT
(
const
SUMOSAXAttributes
& attrs);
222
void
addWAUTSwitch
(
const
SUMOSAXAttributes
& attrs);
223
void
addWAUTJunction
(
const
SUMOSAXAttributes
& attrs);
224
226
void
setLocation
(
const
SUMOSAXAttributes
& attrs);
227
237
void
addDistrict
(
const
SUMOSAXAttributes
& attrs);
238
239
250
void
addDistrictEdge
(
const
SUMOSAXAttributes
& attrs,
bool
isSource);
251
255
void
addRoundabout
(
const
SUMOSAXAttributes
& attrs);
256
257
258
void
closeWAUT
();
259
261
LinkDirection
parseLinkDir
(
const
std::string& dir);
262
264
LinkState
parseLinkState
(
const
std::string& state);
265
266
267
protected
:
269
NLDiscreteEventBuilder
myActionBuilder
;
270
272
bool
myCurrentIsInternalToSkip
;
273
274
276
NLDetectorBuilder
&
myDetectorBuilder
;
277
279
NLTriggerBuilder
&
myTriggerBuilder
;
280
282
NLEdgeControlBuilder
&
myEdgeControlBuilder
;
283
285
NLJunctionControlBuilder
&
myJunctionControlBuilder
;
286
288
std::string
myCurrentDistrictID
;
289
291
bool
myAmInTLLogicMode
;
292
294
std::string
myCurrentWAUTID
;
295
297
Position
myNetworkOffset
;
298
300
Boundary
myOrigBoundary
,
myConvBoundary
;
301
302
bool
myCurrentIsBroken
;
303
304
bool
myHaveWarnedAboutDeprecatedLanes
;
305
306
Parameterised
*
myLastParameterised
;
307
309
bool
myHaveSeenInternalEdge
;
310
311
312
private
:
314
NLHandler
(
const
NLHandler
& s);
315
317
NLHandler
&
operator=
(
const
NLHandler
& s);
318
319
};
320
321
322
#endif
323
324
/****************************************************************************/
325
home
delphi
sumo
src
netload
NLHandler.h
Generated by
1.8.2