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
/****************************************************************************/
7
// A complete traffic light logic loaded from a sumo-net. (opted to reimplement
8
// since NBLoadedTLDef is quite vissim specific)
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
11
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
12
/****************************************************************************/
13
//
14
// This file is part of SUMO.
15
// SUMO is free software: you can redistribute it and/or modify
16
// it under the terms of the GNU General Public License as published by
17
// the Free Software Foundation, either version 3 of the License, or
18
// (at your option) any later version.
19
//
20
/****************************************************************************/
21
#ifndef NBLoadedSUMOTLDef_h
22
#define NBLoadedSUMOTLDef_h
23
24
25
// ===========================================================================
26
// included modules
27
// ===========================================================================
28
#ifdef _MSC_VER
29
#include <
windows_config.h
>
30
#else
31
#include <
config.h
>
32
#endif
33
34
#include <vector>
35
#include <string>
36
#include <set>
37
#include "
NBNode.h
"
38
#include "
NBEdgeCont.h
"
39
#include "
NBTrafficLightDefinition.h
"
40
#include "
NBTrafficLightLogic.h
"
41
#include <
utils/common/SUMOTime.h
>
42
43
44
// ===========================================================================
45
// class definitions
46
// ===========================================================================
51
class
NBLoadedSUMOTLDef
:
public
NBTrafficLightDefinition
{
52
public
:
53
59
NBLoadedSUMOTLDef
(
const
std::string&
id
,
const
std::string& programID,
SUMOTime
offset);
60
65
NBLoadedSUMOTLDef
(
NBTrafficLightDefinition
* def,
NBTrafficLightLogic
* logic);
66
67
69
~NBLoadedSUMOTLDef
() ;
70
74
void
setTLControllingInformation
(
const
NBEdgeCont
& ec)
const
;
75
81
void
remapRemoved
(
NBEdge
* removed,
82
const
EdgeVector
& incoming,
const
EdgeVector
& outgoing) ;
83
84
91
void
replaceRemoved
(
NBEdge
* removed,
int
removedLane,
92
NBEdge
* by,
int
byLane) ;
93
99
void
addPhase
(
SUMOTime
duration,
const
std::string& state);
100
101
104
void
addConnection
(
NBEdge
* from,
NBEdge
* to,
int
fromLane,
int
toLane,
int
linkIndex);
105
106
111
void
removeConnection
(
const
NBConnection
& conn,
bool
reconstruct =
true
);
112
115
NBTrafficLightLogic
*
getLogic
() {
116
return
myTLLogic
;
117
}
118
119
120
protected
:
124
void
collectLinks
() {}
125
126
132
NBTrafficLightLogic
*
myCompute
(
const
NBEdgeCont
& ec,
133
unsigned
int
brakingTime) ;
134
135
bool
amInvalid
()
const
;
136
137
private
:
138
140
NBTrafficLightLogic
*
myTLLogic
;
141
143
std::set<NBNode*>
myOriginalNodes
;
144
146
void
setTLControllingInformation
()
const
;
147
148
private
:
150
class
connection_equal
{
151
public
:
153
connection_equal
(
const
NBConnection
& c) :
myC
(c) {}
154
155
bool
operator()
(
const
NBConnection
& c)
const
{
156
return
c.
getFrom
() ==
myC
.
getFrom
() && c.
getTo
() ==
myC
.
getTo
() &&
157
c.
getFromLane
() ==
myC
.
getFromLane
() && c.
getToLane
() ==
myC
.
getToLane
();
158
}
159
private
:
160
const
NBConnection
&
myC
;
161
private
:
163
connection_equal
&
operator=
(
const
connection_equal
& s);
164
165
};
166
167
};
168
169
170
#endif
171
172
/****************************************************************************/
173
build
buildd
sumo-0.15.0~dfsg
src
netbuild
NBLoadedSUMOTLDef.h
Generated on Wed Jul 18 2012 22:58:34 for SUMO - Simulation of Urban MObility by
1.8.1.1