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
MSDevice_Vehroutes.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// A device which collects info on the vehicle trip
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 MSDevice_Vehroutes_h
22
#define MSDevice_Vehroutes_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 "
MSDevice.h
"
35
#include <
microsim/MSNet.h
>
36
#include <
utils/common/SUMOTime.h
>
37
38
39
// ===========================================================================
40
// class declarations
41
// ===========================================================================
42
class
MSEdge
;
43
class
MSRoute
;
44
45
46
// ===========================================================================
47
// class definitions
48
// ===========================================================================
57
class
MSDevice_Vehroutes
:
public
MSDevice
{
58
public
:
61
static
void
init
();
62
63
74
static
MSDevice_Vehroutes
*
buildVehicleDevices
(
SUMOVehicle
& v, std::vector<MSDevice*> &into,
unsigned
int
maxRoutes = INT_MAX) ;
75
76
77
public
:
80
89
bool
notifyEnter
(
SUMOVehicle
& veh,
MSMoveReminder::Notification
reason) ;
90
91
103
bool
notifyLeave
(
SUMOVehicle
& veh,
SUMOReal
lastPos,
Notification
reason) ;
105
106
113
void
generateOutput
()
const
;
114
115
121
const
MSRoute
*
getRoute
(
int
index)
const
;
122
123
125
~MSDevice_Vehroutes
() ;
126
127
128
private
:
134
MSDevice_Vehroutes
(
SUMOVehicle
& holder,
const
std::string&
id
,
unsigned
int
maxRoutes) ;
135
136
142
void
writeXMLRoute
(
OutputDevice
& os,
int
index = -1)
const
;
143
144
147
void
addRoute
();
148
149
150
private
:
152
static
bool
mySaveExits
;
153
155
static
bool
myLastRouteOnly
;
156
158
static
bool
mySorted
;
159
161
static
bool
myWithTaz
;
162
163
class
StateListener
:
public
MSNet::VehicleStateListener
{
164
public
:
166
~StateListener
() {}
167
172
void
vehicleStateChanged
(
const
SUMOVehicle
*
const
vehicle,
MSNet::VehicleState
to);
173
175
std::map<const SUMOVehicle*, MSDevice_Vehroutes*>
myDevices
;
176
};
177
178
static
StateListener
myStateListener
;
179
180
static
std::map<const SUMOTime, int>
myDepartureCounts
;
181
182
static
std::map<const SUMOTime, std::string>
myRouteInfos
;
183
193
class
RouteReplaceInfo
{
194
public
:
196
RouteReplaceInfo
(
const
MSEdge
*
const
edge_,
const
SUMOTime
time_,
const
MSRoute
*
const
route_)
197
:
edge
(edge_),
time
(time_),
route
(route_) {}
198
200
~RouteReplaceInfo
() { }
201
203
const
MSEdge
*
edge
;
204
206
SUMOTime
time
;
207
209
const
MSRoute
*
route
;
210
211
};
212
213
const
MSRoute
*
myCurrentRoute
;
214
std::vector<RouteReplaceInfo>
myReplacedRoutes
;
215
std::vector<SUMOTime>
myExits
;
216
const
unsigned
int
myMaxRoutes
;
217
const
MSEdge
*
myLastSavedAt
;
218
219
private
:
221
MSDevice_Vehroutes
(
const
MSDevice_Vehroutes
&);
222
224
MSDevice_Vehroutes
&
operator=
(
const
MSDevice_Vehroutes
&);
225
226
227
};
228
229
230
#endif
231
232
/****************************************************************************/
233
tmp
buildd
sumo-0.15.0~dfsg
src
microsim
devices
MSDevice_Vehroutes.h
Generated on Sun May 27 2012 14:52:06 for SUMO - Simulation of Urban MObility by
1.8.1