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
NLJunctionControlBuilder.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// Builder of microsim-junctions and tls
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef NLJunctionControlBuilder_h
23
#define NLJunctionControlBuilder_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <string>
36
#include <vector>
37
#include <
microsim/MSJunction.h
>
38
#include <
microsim/MSRightOfWayJunction.h
>
39
#include <
microsim/MSJunctionControl.h
>
40
#include <
utils/geom/Position.h
>
41
#include <
utils/geom/PositionVector.h
>
42
#include <
microsim/traffic_lights/MSSimpleTrafficLightLogic.h
>
43
#include <
microsim/traffic_lights/MSActuatedTrafficLightLogic.h
>
44
#include <
microsim/MSBitSetLogic.h
>
45
#include <
microsim/traffic_lights/MSTLLogicControl.h
>
46
#include <
utils/common/UtilExceptions.h
>
47
48
49
// ===========================================================================
50
// class declarations
51
// ===========================================================================
52
class
OptionsCont
;
53
class
NLDetectorBuilder
;
54
55
56
// ===========================================================================
57
// class definitions
58
// ===========================================================================
69
class
NLJunctionControlBuilder
{
70
private
:
72
typedef
std::vector<MSLane*>
LaneVector
;
73
74
public
:
82
NLJunctionControlBuilder
(
MSNet
& net,
NLDetectorBuilder
& db);
83
84
90
virtual
~NLJunctionControlBuilder
();
91
92
106
void
openJunction
(
const
std::string&
id
,
const
std::string& key,
107
const
SumoXMLNodeType
type,
SUMOReal
x,
SUMOReal
y,
108
const
PositionVector
& shape,
109
const
std::vector<MSLane*>& incomingLanes,
110
const
std::vector<MSLane*>& internalLanes);
111
112
125
void
closeJunction
();
126
127
135
MSJunctionControl
*
build
()
const
;
136
137
141
void
initJunctionLogic
(
const
std::string&
id
);
142
143
155
void
addLogicItem
(
int
request,
const
std::string& response,
156
const
std::string& foes,
bool
cont);
157
158
168
void
initTrafficLightLogic
(
const
std::string&
id
,
const
std::string& programID,
169
TrafficLightType
type,
SUMOTime
offset);
170
171
181
void
addPhase
(
SUMOTime
duration,
const
std::string& state,
182
int
min
,
int
max
);
183
184
191
MSTLLogicControl::TLSLogicVariants
&
getTLLogic
(
const
std::string&
id
)
192
const
;
193
194
204
MSTLLogicControl
*
buildTLLogics
()
const
;
205
206
215
virtual
void
closeTrafficLightLogic
();
216
217
228
void
closeJunctionLogic
();
229
230
238
void
addParam
(
const
std::string& key,
const
std::string& value);
239
240
244
const
std::string&
getActiveKey
()
const
;
245
246
250
const
std::string&
getActiveSubKey
()
const
;
251
252
260
MSTLLogicControl
&
getTLLogicControlToUse
()
const
;
261
263
void
postLoadInitialization
();
264
266
MSJunction
*
retrieve
(
const
std::string
id
);
267
268
269
protected
:
279
MSJunctionLogic
*
getJunctionLogicSecure
();
280
281
282
protected
:
285
292
virtual
MSJunction
*
buildNoLogicJunction
();
293
294
303
virtual
MSJunction
*
buildLogicJunction
();
304
305
306
#ifdef HAVE_INTERNAL_LANES
307
313
virtual
MSJunction
* buildInternalJunction();
314
#endif
315
316
317
318
protected
:
320
MSNet
&
myNet
;
321
323
NLDetectorBuilder
&
myDetectorBuilder
;
324
326
SUMOTime
myOffset
;
327
329
TrafficLightType
myLogicType
;
330
332
MSBitsetLogic::Logic
myActiveLogic
;
333
335
MSBitsetLogic::Foes
myActiveFoes
;
336
338
std::bitset<64>
myActiveConts
;
339
341
MSSimpleTrafficLightLogic::Phases
myActivePhases
;
342
344
int
myRequestSize
;
345
347
int
myRequestItemNumber
;
348
350
mutable
MSJunctionControl
*
myJunctions
;
351
353
LaneVector
myActiveIncomingLanes
;
354
355
#ifdef HAVE_INTERNAL_LANES
356
357
LaneVector
myActiveInternalLanes;
358
#endif
359
361
std::string
myActiveID
;
362
364
std::string
myActiveKey
,
myActiveProgram
;
365
367
SumoXMLNodeType
myType
;
368
370
Position
myPosition
;
371
373
SUMOTime
myAbsDuration
;
374
376
PositionVector
myShape
;
377
378
380
std::vector<MSTrafficLightLogic*>
myLogics2PostLoadInit
;
381
382
384
mutable
MSTLLogicControl
*
myLogicControl
;
385
386
388
typedef
std::map<std::string, std::string>
StringParameterMap
;
389
391
StringParameterMap
myAdditionalParameter
;
392
393
395
std::map<std::string, MSJunctionLogic*>
myLogics
;
396
398
bool
myCurrentHasError
;
399
400
401
private
:
403
NLJunctionControlBuilder
(
const
NLJunctionControlBuilder
& s);
404
406
NLJunctionControlBuilder
&
operator=
(
const
NLJunctionControlBuilder
& s);
407
408
static
const
int
NO_REQUEST_SIZE
;
409
411
bool
myNetIsLoaded
;
412
413
};
414
415
416
#endif
417
418
/****************************************************************************/
419
tmp
buildd
sumo-0.21.0+dfsg
src
netload
NLJunctionControlBuilder.h
Generated on Thu Nov 20 2014 19:49:57 for SUMO - Simulation of Urban MObility by
1.8.1.2