Commit 507cadda authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

Check to catch undetected error in TestEvacuationTimeProcessor

parent 48ab29e4
......@@ -42,15 +42,24 @@ public class TestPedestrianEvacuationTimeProcessor extends TestProcessor {
@Override
public void postLoop(SimulationState state) {
Double maximalEvacTime = getAttributes().getMaximalEvacuationTime();
Double minimalEvacTime = getAttributes().getMinimalEvacuationTime();
Double finishTime = state.getScenarioStore().getAttributesSimulation().getFinishTime();
// See issue #249, this is only for security such that the tests work correctly
if(finishTime <= maximalEvacTime){
handleAssertion(false,
"finishTime in Simulation options has to be larger than maximalEvacTime");
}
pedestrianEvacuationTimeProcessor.postLoop(state);
int invalidEvacuationTimes = 0;
for(PedestrianIdKey key : pedestrianEvacuationTimeProcessor.getKeys()) {
Double evacTime = pedestrianEvacuationTimeProcessor.getValue(key);
Double maximalEvacTime = getAttributes().getMaximalEvacuationTime();
Double minimalEvacTime = getAttributes().getMinimalEvacuationTime();
if((evacTime == Double.POSITIVE_INFINITY && maximalEvacTime != Double.POSITIVE_INFINITY) ||
(evacTime < minimalEvacTime || evacTime > maximalEvacTime)) {
invalidEvacuationTimes++;
......@@ -63,7 +72,7 @@ public class TestPedestrianEvacuationTimeProcessor extends TestProcessor {
@Override
public AttributesTestPedestrianEvacuationTimeProcessor getAttributes() {
if (super.getAttributes() == null) {
setAttributes(new AttributesTestNumberOverlapsProcessor());
setAttributes(new AttributesTestPedestrianEvacuationTimeProcessor());
}
return (AttributesTestPedestrianEvacuationTimeProcessor)super.getAttributes();
......
Markdown is supported
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