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.sourceforge.net/
13
// Copyright (C) 2001-2012 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/xml/SUMOXMLDefinitions.h
>
41
#include <
microsim/MSLink.h
>
42
#include <
microsim/MSRouteHandler.h
>
43
#include <
microsim/traffic_lights/MSSimpleTrafficLightLogic.h
>
44
#include <
microsim/traffic_lights/MSActuatedTrafficLightLogic.h
>
45
#include <
microsim/MSBitSetLogic.h
>
46
#include "
NLBuilder.h
"
47
#include "
NLDiscreteEventBuilder.h
"
48
#include "
NLSucceedingLaneBuilder.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
96
protected
:
98
99
108
virtual
void
myStartElement
(
int
element,
109
const
SUMOSAXAttributes
& attrs) ;
110
111
119
virtual
void
myEndElement
(
int
element) ;
121
122
123
protected
:
124
void
addParam
(
const
SUMOSAXAttributes
& attrs);
125
129
virtual
void
addE1Detector
(
const
SUMOSAXAttributes
& attrs);
130
134
virtual
void
addInstantE1Detector
(
const
SUMOSAXAttributes
& attrs);
135
139
virtual
void
addE2Detector
(
const
SUMOSAXAttributes
& attrs);
140
144
void
beginE3Detector
(
const
SUMOSAXAttributes
& attrs);
145
149
void
addE3Entry
(
const
SUMOSAXAttributes
& attrs);
150
154
void
addE3Exit
(
const
SUMOSAXAttributes
& attrs);
155
157
virtual
void
endE3Detector
();
158
162
virtual
void
addVTypeProbeDetector
(
const
SUMOSAXAttributes
& attrs);
163
167
virtual
void
addRouteProbeDetector
(
const
SUMOSAXAttributes
& attrs);
168
173
virtual
void
addEdgeLaneMeanData
(
const
SUMOSAXAttributes
& attrs,
int
objecttype);
174
176
virtual
void
closeEdge
();
177
178
179
protected
:
181
MSNet
&
myNet
;
182
183
184
private
:
186
void
beginEdgeParsing
(
const
SUMOSAXAttributes
& attrs);
187
189
void
addLane
(
const
SUMOSAXAttributes
& attrs);
190
192
void
addPOI
(
const
SUMOSAXAttributes
& attrs);
193
195
void
addPoly
(
const
SUMOSAXAttributes
& attrs);
196
198
void
addLogicItem
(
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
218
#ifdef _MESSAGES
219
220
void
addMsgEmitter(
const
SUMOSAXAttributes
& attrs);
221
#endif
222
224
void
openSucc
(
const
SUMOSAXAttributes
& attrs);
225
227
void
addSuccLane
(
const
SUMOSAXAttributes
& attrs);
228
230
void
addConnection
(
const
SUMOSAXAttributes
& attrs);
231
232
virtual
void
openWAUT
(
const
SUMOSAXAttributes
& attrs);
233
void
addWAUTSwitch
(
const
SUMOSAXAttributes
& attrs);
234
void
addWAUTJunction
(
const
SUMOSAXAttributes
& attrs);
235
237
void
setLocation
(
const
SUMOSAXAttributes
& attrs);
238
248
void
addDistrict
(
const
SUMOSAXAttributes
& attrs) ;
249
250
261
void
addDistrictEdge
(
const
SUMOSAXAttributes
& attrs,
bool
isSource);
262
263
264
void
closeWAUT
();
265
267
void
closeSuccLane
();
268
270
LinkDirection
parseLinkDir
(
const
std::string& dir);
271
273
LinkState
parseLinkState
(
const
std::string& state);
274
276
std::pair<MSLane*, MSLane*>
getLanesFromIndices
(
MSEdge
* from,
MSEdge
* to,
const
std::string& laneIndices,
bool
& ok);
277
278
279
protected
:
281
NLDiscreteEventBuilder
myActionBuilder
;
282
284
bool
myCurrentIsInternalToSkip
;
285
286
288
NLDetectorBuilder
&
myDetectorBuilder
;
289
291
NLTriggerBuilder
&
myTriggerBuilder
;
292
294
NLEdgeControlBuilder
&
myEdgeControlBuilder
;
295
297
NLJunctionControlBuilder
&
myJunctionControlBuilder
;
298
300
NLSucceedingLaneBuilder
mySucceedingLaneBuilder
;
301
302
303
305
std::string
myCurrentDistrictID
;
306
308
bool
myAmInTLLogicMode
;
309
311
std::string
myCurrentWAUTID
;
312
314
Position
myNetworkOffset
;
315
317
Boundary
myOrigBoundary
,
myConvBoundary
;
318
319
bool
myCurrentIsBroken
;
320
321
bool
myHaveWarnedAboutDeprecatedE1
,
myHaveWarnedAboutDeprecatedE2
,
322
myHaveWarnedAboutDeprecatedE3
,
myHaveWarnedAboutDeprecatedDetEntry
,
323
myHaveWarnedAboutDeprecatedDetExit
,
myHaveWarnedAboutDeprecatedTimedEvent
;
324
bool
myHaveWarnedAboutDeprecatedRowLogic
,
myHaveWarnedAboutDeprecatedTLLogic
;
325
bool
myHaveWarnedAboutDeprecatedTLSTiming
;
326
bool
myHaveWarnedAboutDeprecatedTimeThreshold
,
327
myHaveWarnedAboutDeprecatedSpeedThreshold
,
328
myHaveWarnedAboutDeprecatedJamDistThreshold
;
329
bool
myHaveWarnedAboutDeprecatedVTypeProbe
,
myHaveWarnedAboutDeprecatedRouteProbe
,
330
myHaveWarnedAboutDeprecatedEdgeMean
,
myHaveWarnedAboutDeprecatedLaneMean
;
331
bool
myHaveWarnedAboutDeprecatedVTypes
,
myHaveWarnedAboutDeprecatedLanes
;
332
bool
myHaveWarnedAboutDeprecatedDistrict
,
myHaveWarnedAboutDeprecatedDSource
,
myHaveWarnedAboutDeprecatedDSink
;
333
334
335
private
:
337
NLHandler
(
const
NLHandler
& s);
338
340
NLHandler
&
operator=
(
const
NLHandler
& s);
341
342
};
343
344
345
#endif
346
347
/****************************************************************************/
348
var
build
temp
tmp.znCyBrHNjL
4.0-0-0
sumo
sumo-0.15.0~dfsg
src
netload
NLHandler.h
Generated on Mon Mar 24 2014 09:53:13 for SUMO - Simulation of Urban MObility by
1.8.1.2