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
NBLoadedSUMOTLDef.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// A complete traffic light logic loaded from a sumo-net. (opted to reimplement
9
// since NBLoadedTLDef is quite vissim specific)
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2011-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 NBLoadedSUMOTLDef_h
23
#define NBLoadedSUMOTLDef_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 <vector>
36
#include <string>
37
#include <set>
38
#include "
NBNode.h
"
39
#include "
NBEdgeCont.h
"
40
#include "
NBTrafficLightDefinition.h
"
41
#include "
NBTrafficLightLogic.h
"
42
#include <
utils/common/SUMOTime.h
>
43
44
45
// ===========================================================================
46
// class definitions
47
// ===========================================================================
52
class
NBLoadedSUMOTLDef
:
public
NBTrafficLightDefinition
{
53
public
:
54
61
NBLoadedSUMOTLDef
(
const
std::string&
id
,
const
std::string& programID,
SUMOTime
offset,
TrafficLightType
type);
62
67
NBLoadedSUMOTLDef
(
NBTrafficLightDefinition
* def,
NBTrafficLightLogic
* logic);
68
69
71
~NBLoadedSUMOTLDef
();
72
76
void
setTLControllingInformation
(
const
NBEdgeCont
& ec)
const
;
77
83
void
remapRemoved
(
NBEdge
* removed,
84
const
EdgeVector
& incoming,
const
EdgeVector
& outgoing);
85
86
93
void
replaceRemoved
(
NBEdge
* removed,
int
removedLane,
94
NBEdge
* by,
int
byLane);
95
97
void
shiftTLConnectionLaneIndex
(
NBEdge
* edge,
int
offset);
98
104
void
addPhase
(
SUMOTime
duration,
const
std::string& state);
105
106
109
void
addConnection
(
NBEdge
* from,
NBEdge
* to,
int
fromLane,
int
toLane,
int
linkIndex);
110
111
116
void
removeConnection
(
const
NBConnection
& conn,
bool
reconstruct =
true
);
117
120
NBTrafficLightLogic
*
getLogic
() {
121
return
myTLLogic
;
122
}
123
127
void
setOffset
(
SUMOTime
offset);
128
129
protected
:
133
void
collectLinks
();
134
135
141
NBTrafficLightLogic
*
myCompute
(
const
NBEdgeCont
& ec,
142
unsigned
int
brakingTime);
143
144
bool
amInvalid
()
const
;
145
146
private
:
147
149
NBTrafficLightLogic
*
myTLLogic
;
150
152
std::set<NBNode*>
myOriginalNodes
;
153
155
void
setTLControllingInformation
()
const
;
156
158
void
patchIfCrossingsAdded
();
159
161
std::set<NBEdge*>
myShifted
;
162
163
private
:
165
class
connection_equal
{
166
public
:
168
connection_equal
(
const
NBConnection
& c) :
myC
(c) {}
169
170
bool
operator()
(
const
NBConnection
& c)
const
{
171
return
c.
getFrom
() ==
myC
.
getFrom
() && c.
getTo
() ==
myC
.
getTo
() &&
172
c.
getFromLane
() ==
myC
.
getFromLane
() && c.
getToLane
() ==
myC
.
getToLane
();
173
}
174
private
:
175
const
NBConnection
&
myC
;
176
private
:
178
connection_equal
&
operator=
(
const
connection_equal
& s);
179
180
};
181
182
};
183
184
185
#endif
186
187
/****************************************************************************/
188
tmp
buildd
sumo-0.21.0+dfsg
src
netbuild
NBLoadedSUMOTLDef.h
Generated on Thu Nov 20 2014 19:49:56 for SUMO - Simulation of Urban MObility by
1.8.1.2