Skip to content
Permalink
Browse files

fix #4756

  • Loading branch information...
namdre committed Nov 6, 2018
1 parent afa49f6 commit 01625b0fa73cb5aa70f3e42fd21d0aaeaaac6c8a
Showing with 6 additions and 4 deletions.
  1. +5 −3 src/microsim/output/MSE3Collector.cpp
  2. +1 −1 src/microsim/output/MSE3Collector.h
@@ -240,7 +240,7 @@ MSE3Collector::enter(const SUMOVehicle& veh, const double entryTimestep, const d
v.frontLeaveTime = 0;
v.backLeaveTime = 0;
v.speedSum = speedFraction;
v.haltingBegin = veh.getSpeed() < myHaltingSpeedThreshold ? entryTimestep : -1;
v.haltingBegin = veh.getSpeed() < myHaltingSpeedThreshold ? TIME2STEPS(entryTimestep) : -1;
v.intervalSpeedSum = entryTimestep >= STEPS2TIME(myLastResetTime) ? speedFraction : 0;
v.haltings = 0;
v.intervalHaltings = 0;
@@ -409,9 +409,11 @@ MSE3Collector::detectorUpdate(const SUMOTime step) {
values.intervalSpeedSum += veh->getSpeed() * TS;
if (veh->getSpeed() < myHaltingSpeedThreshold) {
if (values.haltingBegin == -1) {
values.haltingBegin = STEPS2TIME(step);
values.haltingBegin = step;
}
if (step - values.haltingBegin > myHaltingTimeThreshold) {
SUMOTime haltingDuration = step - values.haltingBegin;
if (haltingDuration >= myHaltingTimeThreshold
&& haltingDuration < (myHaltingTimeThreshold + DELTA_T)) {
values.haltings++;
values.intervalHaltings++;
myCurrentHaltingsNumber++;
@@ -379,7 +379,7 @@ class MSE3Collector : public MSDetectorFileOutput {
/// @brief The sum of haltings the vehicle has/had within the area
int haltings;
/// @brief Begin time of last halt begin
double haltingBegin;
SUMOTime haltingBegin;
/// @brief The sum of registered speeds the vehicle has/had inside the area during the current interval
double intervalSpeedSum;
/// @brief The sum of haltings the vehicle has/had within the area during the current interval

0 comments on commit 01625b0

Please sign in to comment.
You can’t perform that action at this time.