Commit 38ad54dc authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

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

parent a54698f4
......@@ -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