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
MSAgentbasedTrafficLightLogic.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// An agentbased traffic light logic
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2013 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 MSAgentbasedTrafficLightLogic_h
23
#define MSAgentbasedTrafficLightLogic_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 <utility>
36
#include <vector>
37
#include <bitset>
38
#include <map>
39
#include "
MSTrafficLightLogic.h
"
40
#include "
MSSimpleTrafficLightLogic.h
"
41
#include <
microsim/output/MS_E2_ZS_CollectorOverLanes.h
>
42
43
44
// ===========================================================================
45
// class declarations
46
// ===========================================================================
47
class
MSLane
;
48
class
MSAgentbasedPhaseDefinition;
49
class
NLDetectorBuilder
;
50
51
52
// ===========================================================================
53
// class definitions
54
// ===========================================================================
59
class
MSAgentbasedTrafficLightLogic
:
60
public
MSSimpleTrafficLightLogic
{
61
public
:
63
typedef
std::map<MSLane*, MS_E2_ZS_CollectorOverLanes*>
E2DetectorMap
;
64
66
typedef
std::deque<SUMOReal>
ValueType
;
67
69
typedef
std::map<unsigned int, ValueType>
PhaseValueMap
;
70
72
typedef
std::map<unsigned int, SUMOReal>
MeanDataMap
;
73
74
public
:
84
MSAgentbasedTrafficLightLogic
(
MSTLLogicControl
& tlcontrol,
85
const
std::string&
id
,
const
std::string& programID,
86
const
MSSimpleTrafficLightLogic::Phases
& phases,
87
unsigned
int
step,
SUMOTime
delay,
88
const
ParameterMap
& parameter);
89
90
96
void
init
(
NLDetectorBuilder
& nb);
97
98
100
~MSAgentbasedTrafficLightLogic
();
101
102
103
106
112
SUMOTime
trySwitch
(
bool
isActive);
114
115
116
protected
:
119
126
unsigned
int
nextStep
();
127
128
131
void
collectData
();
132
133
136
void
aggregateRawData
();
137
138
141
void
calculateDuration
();
142
143
147
void
lengthenCycleTime
(
unsigned
int
toLenghten);
148
149
153
void
cutCycleTime
(
unsigned
int
toCut);
154
155
159
unsigned
int
findStepOfMaxValue
()
const
;
160
161
165
unsigned
int
findStepOfMinValue
()
const
;
167
168
169
protected
:
171
E2DetectorMap
myE2Detectors
;
172
174
PhaseValueMap
myRawDetectorData
;
175
177
MeanDataMap
myMeanDetectorData
;
178
182
unsigned
int
tDecide
;
183
185
unsigned
int
tSinceLastDecision
;
186
188
unsigned
int
stepOfLastDecision
;
189
193
unsigned
int
numberOfValues
;
194
196
unsigned
int
tCycle
;
197
198
/* @brief The minimum difference between the shortest and the longest que
199
*
200
* Queue_Lengt_Ahead_Of_Traffic_Lights of a phase before greentime is given
201
* from the phase with the shortest Queue_Lengt_Ahead_Of_Traffic_Lights to the phase with
202
* the longest Queue_Lengt_Ahead_Of_Traffic_Lights */
203
SUMOReal
deltaLimit
;
204
205
};
206
207
208
#endif
209
210
/****************************************************************************/
211
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
microsim
traffic_lights
MSAgentbasedTrafficLightLogic.h
Generated on Sun Jun 16 2013 07:07:27 for SUMO - Simulation of Urban MObility by
1.8.1.2