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
MSTriggeredRerouter.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// Reroutes vehicles passing an edge
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 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 MSTriggeredRerouter_h
23
#define MSTriggeredRerouter_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 <
utils/common/Command.h
>
38
#include <
microsim/MSMoveReminder.h
>
39
#include "
MSTrigger.h
"
40
#include <
utils/xml/SUMOSAXHandler.h
>
41
#include <
utils/common/RandomDistributor.h
>
42
43
44
// ===========================================================================
45
// class declarations
46
// ===========================================================================
47
class
MSNet
;
48
class
MSLane
;
49
class
MSRoute
;
50
class
SUMOVehicle
;
51
52
53
// ===========================================================================
54
// class definitions
55
// ===========================================================================
67
class
MSTriggeredRerouter
:
68
public
MSTrigger
,
public
MSMoveReminder
,
69
public
SUMOSAXHandler
{
70
public
:
78
MSTriggeredRerouter
(
const
std::string&
id
,
79
const
std::vector<MSEdge*>& edges,
80
SUMOReal
prob,
const
std::string& file,
bool
off);
81
82
84
virtual
~MSTriggeredRerouter
();
85
86
91
struct
RerouteInterval
{
93
SUMOTime
begin
;
95
SUMOTime
end
;
97
std::vector<MSEdge*>
closed
;
99
RandomDistributor<MSEdge*>
edgeProbs
;
101
RandomDistributor<const MSRoute*>
routeProbs
;
102
};
103
118
bool
notifyEnter
(
SUMOVehicle
& veh,
MSMoveReminder::Notification
reason);
119
121
bool
hasCurrentReroute
(
SUMOTime
time,
SUMOVehicle
& veh)
const
;
122
124
const
RerouteInterval
&
getCurrentReroute
(
SUMOTime
time,
SUMOVehicle
& veh)
const
;
125
127
bool
hasCurrentReroute
(
SUMOTime
time)
const
;
128
130
const
RerouteInterval
&
getCurrentReroute
(
SUMOTime
time)
const
;
131
133
void
setUserMode
(
bool
val);
134
136
void
setUserUsageProbability
(
SUMOReal
prob);
137
139
bool
inUserMode
()
const
;
140
142
SUMOReal
getProbability
()
const
;
143
145
SUMOReal
getUserProbability
()
const
;
146
147
protected
:
149
150
158
virtual
void
myStartElement
(
int
element,
159
const
SUMOSAXAttributes
& attrs);
160
161
168
void
myEndElement
(
int
element);
170
171
protected
:
173
std::vector<RerouteInterval>
myIntervals
;
174
176
SUMOReal
myProbability
,
myUserProbability
;
177
179
bool
myAmInUserMode
;
180
182
183
185
SUMOTime
myCurrentIntervalBegin
,
myCurrentIntervalEnd
;
187
std::vector<MSEdge*>
myCurrentClosed
;
189
RandomDistributor<MSEdge*>
myCurrentEdgeProb
;
191
RandomDistributor<const MSRoute*>
myCurrentRouteProb
;
193
194
196
static
MSEdge
mySpecialDest_keepDestination
;
197
static
MSEdge
mySpecialDest_terminateRoute
;
198
199
private
:
201
MSTriggeredRerouter
(
const
MSTriggeredRerouter
&);
202
204
MSTriggeredRerouter
&
operator=
(
const
MSTriggeredRerouter
&);
205
206
207
};
208
209
210
#endif
211
212
/****************************************************************************/
213
build
buildd
sumo-0.16.0~dfsg
src
microsim
trigger
MSTriggeredRerouter.h
Generated on Tue Apr 16 2013 01:32:18 for SUMO - Simulation of Urban MObility by
1.8.3.1