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
MSE2Collector.h
Go to the documentation of this file.
1
/****************************************************************************/
12
// An areal (along a single lane) detector
13
/****************************************************************************/
14
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
15
// Copyright (C) 2014 DLR (http://www.dlr.de/) and contributors
16
/****************************************************************************/
17
//
18
// This file is part of SUMO.
19
// SUMO is free software: you can redistribute it and/or modify
20
// it under the terms of the GNU General Public License as published by
21
// the Free Software Foundation, either version 3 of the License, or
22
// (at your option) any later version.
23
//
24
/****************************************************************************/
25
#ifndef MSE2Collector_h
26
#define MSE2Collector_h
27
28
29
// ===========================================================================
30
// included modules
31
// ===========================================================================
32
#ifdef _MSC_VER
33
#include <
windows_config.h
>
34
#else
35
#include <
config.h
>
36
#endif
37
38
#include <vector>
39
#include <list>
40
#include <
microsim/MSLane.h
>
41
#include <
microsim/MSMoveReminder.h
>
42
#include <
microsim/output/MSDetectorFileOutput.h
>
43
#include <
utils/common/UtilExceptions.h
>
44
#include <
utils/common/SUMOVehicle.h
>
45
46
47
// ===========================================================================
48
// class declarations
49
// ===========================================================================
50
class
OutputDevice
;
51
52
53
// ===========================================================================
54
// class definitions
55
// ===========================================================================
79
class
MSE2Collector
:
public
MSMoveReminder
,
public
MSDetectorFileOutput
{
80
public
:
93
MSE2Collector
(
const
std::string&
id
,
DetectorUsage
usage,
94
MSLane
*
const
lane,
SUMOReal
startPos,
SUMOReal
detLength,
95
SUMOTime
haltingTimeThreshold,
SUMOReal
haltingSpeedThreshold,
96
SUMOReal
jamDistThreshold);
97
98
100
virtual
~MSE2Collector
();
101
102
108
virtual
DetectorUsage
getUsageType
()
const
{
109
return
myUsage
;
110
}
111
112
113
116
132
bool
notifyMove
(
SUMOVehicle
& veh,
SUMOReal
oldPos,
SUMOReal
newPos,
133
SUMOReal
newSpeed);
134
135
147
bool
notifyLeave
(
SUMOVehicle
& veh,
SUMOReal
lastPos,
MSMoveReminder::Notification
reason);
148
149
162
bool
notifyEnter
(
SUMOVehicle
& veh,
MSMoveReminder::Notification
reason);
164
165
166
175
void
detectorUpdate
(
const
SUMOTime
step);
176
177
178
181
190
void
writeXMLOutput
(
OutputDevice
& dev,
SUMOTime
startTime,
SUMOTime
stopTime);
191
192
199
void
writeXMLDetectorProlog
(
OutputDevice
& dev)
const
;
201
202
207
SUMOReal
getStartPos
()
const
{
208
return
myStartPos
;
209
}
210
211
216
SUMOReal
getEndPos
()
const
{
217
return
myEndPos
;
218
}
219
220
227
void
reset
();
228
229
232
234
unsigned
getCurrentVehicleNumber
()
const
;
235
237
SUMOReal
getCurrentOccupancy
()
const
;
238
240
SUMOReal
getCurrentMeanSpeed
()
const
;
241
243
SUMOReal
getCurrentMeanLength
()
const
;
244
246
unsigned
getCurrentJamNumber
()
const
;
247
249
unsigned
getCurrentMaxJamLengthInVehicles
()
const
;
250
252
SUMOReal
getCurrentMaxJamLengthInMeters
()
const
;
253
255
unsigned
getCurrentJamLengthInVehicles
()
const
;
256
258
SUMOReal
getCurrentJamLengthInMeters
()
const
;
259
261
unsigned
getCurrentStartedHalts
()
const
;
262
269
SUMOReal
getCurrentHaltingNumber
()
const
;
270
275
std::vector<std::string>
getCurrentVehicleIDs
()
const
;
277
278
279
protected
:
285
struct
JamInfo
{
287
std::list<SUMOVehicle*>::const_iterator
firstStandingVehicle
;
288
290
std::list<SUMOVehicle*>::const_iterator
lastStandingVehicle
;
291
};
292
293
304
class
by_vehicle_position_sorter
{
305
public
:
310
by_vehicle_position_sorter
(
const
MSLane
*
const
lane)
311
:
myLane
(lane) { }
312
313
318
by_vehicle_position_sorter
(
const
by_vehicle_position_sorter
& s)
319
:
myLane
(s.
myLane
) { }
320
321
328
int
operator()
(
const
SUMOVehicle
* v1,
const
SUMOVehicle
* v2);
329
330
private
:
331
by_vehicle_position_sorter
&
operator=
(
const
by_vehicle_position_sorter
&);
// just to avoid a compiler warning
332
private
:
334
const
MSLane
*
const
myLane
;
335
};
336
337
338
private
:
341
343
SUMOReal
myJamHaltingSpeedThreshold
;
345
SUMOTime
myJamHaltingTimeThreshold
;
347
SUMOReal
myJamDistanceThreshold
;
349
SUMOReal
myStartPos
;
351
SUMOReal
myEndPos
;
353
355
DetectorUsage
myUsage
;
356
358
std::list<SUMOVehicle*>
myKnownVehicles
;
359
361
std::map<const SUMOVehicle*, SUMOTime>
myHaltingVehicleDurations
;
362
364
std::map<const SUMOVehicle*, SUMOTime>
myIntervalHaltingVehicleDurations
;
365
367
std::vector<SUMOTime>
myPastStandingDurations
;
368
370
std::vector<SUMOTime>
myPastIntervalStandingDurations
;
371
372
375
377
SUMOReal
mySpeedSum
;
379
SUMOReal
myStartedHalts
;
381
SUMOReal
myJamLengthInMetersSum
;
383
unsigned
myJamLengthInVehiclesSum
;
385
unsigned
myVehicleSamples
;
387
unsigned
myTimeSamples
;
389
SUMOReal
myOccupancySum
;
391
SUMOReal
myMaxOccupancy
;
393
unsigned
myMeanMaxJamInVehicles
;
395
SUMOReal
myMeanMaxJamInMeters
;
397
unsigned
myMaxJamInVehicles
;
399
SUMOReal
myMaxJamInMeters
;
401
unsigned
myMeanVehicleNumber
;
403
unsigned
myMaxVehicleNumber
;
405
406
409
411
SUMOReal
myCurrentOccupancy
;
413
SUMOReal
myCurrentMeanSpeed
;
415
SUMOReal
myCurrentMeanLength
;
417
unsigned
myCurrentJamNo
;
419
SUMOReal
myCurrentMaxJamLengthInMeters
;
421
unsigned
myCurrentMaxJamLengthInVehicles
;
423
SUMOReal
myCurrentJamLengthInMeters
;
425
unsigned
myCurrentJamLengthInVehicles
;
427
unsigned
myCurrentStartedHalts
;
429
SUMOReal
myCurrentHaltingsNumber
;
431
432
433
private
:
435
MSE2Collector
(
const
MSE2Collector
&);
436
438
MSE2Collector
&
operator=
(
const
MSE2Collector
&);
439
440
441
};
442
443
444
#endif
445
446
/****************************************************************************/
447
tmp
buildd
sumo-0.21.0+dfsg
src
microsim
output
MSE2Collector.h
Generated on Thu Nov 20 2014 19:49:55 for SUMO - Simulation of Urban MObility by
1.8.1.2