Commit 5e563801 authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Merge branch 'cherry-pick-67d8cbd0' into 'master'

Fixed: Critical Bug in Movement Pause Time Calculations

See merge request simonstrator/simonstrator-peerfactsim!27
parents 4e096137 94c7ebd9
......@@ -111,8 +111,12 @@ public class ModularMultiTypeMovementModel extends ModularMovementModel
.getComponentOrNull(Topology.class)
.getWorldDimensions().getY();
} else {
if(transitions.containsKey(ms)) transitions.get(ms).reachedAttractionPoint(ms);
else transition.reachedAttractionPoint(ms);
if(transitions.containsKey(ms)) {
transitions.get(ms).reachedAttractionPoint(ms);
}
else {
transition.reachedAttractionPoint(ms);
}
movementListeners.forEach(l -> l.onTransition(ms));
}
}
......
......@@ -125,7 +125,12 @@ public class WeightedTransitionStrategy implements ITransitionStrategy, EventHan
}
@Override
public void reachedAttractionPoint(SimLocationActuator ms) {
public void reachedAttractionPoint(SimLocationActuator ms) {
// JZ: Added this to prevent multiple calls while pausing
if (!this.assignments.containsKey(ms)) {
return;
}
this.lastAssignments.put(ms, this.assignments.remove(ms));
Event.scheduleWithDelay(getPauseTime(ms), this, ms, EVENT_PAUSE_ENDED);
}
......
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