Commit 6184e520 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

Merge branch '287-measurements-if-no-agent-is-in-the-measurement-area' into 'master'

Resolve "Measurements if no Agent is in the measurement area"

Closes #287

See merge request !99
parents a54698f4 38ad54dc
Pipeline #189671 passed with stages
in 126 minutes and 53 seconds
......@@ -50,7 +50,8 @@ public class AreaSpeedProcessor extends AreaDataProcessor<Double> {
}
}
this.putValue(new TimestepKey(step), (pedCount > 0 ? sumVelocities / pedCount : 0.0));
// Insert a NaN value if there are no agents available (see #287)
this.putValue(new TimestepKey(step), (pedCount > 0 ? sumVelocities / pedCount : Double.NaN));
}
@Override
......
......@@ -115,7 +115,9 @@ public class AreaSpeedProcessorTestEnv extends ProcessorTestEnv<TimestepKey, Dou
when(state.getSimTimeInSec()).thenReturn(simTime);
int step = state.getStep();
addToExpectedOutput(new TimestepKey(step), 0.0);
// if no agent is in the area, then return NaN (see #287)
addToExpectedOutput(new TimestepKey(step), Double.NaN);
}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment