Commit 26bc14b8 authored by Julian Zobel's avatar Julian Zobel
Browse files

Pause time for AP roaming strategy

parent 96cc40f8
......@@ -51,9 +51,12 @@ public class AttractionPointRoamingStrategy extends AbstractAttractionBasedAssig
protected Map<SimLocationActuator, roamingTransitionState> roamingStates = new LinkedHashMap<>();
@XMLConfigurableConstructor({ "defaultPauseTimeMin", "defaultPauseTimeMax" })
public AttractionPointRoamingStrategy(long defaultPauseTimeMin, long defaultPauseTimeMax) {
protected long roamingPauseTime;
@XMLConfigurableConstructor({ "defaultPauseTimeMin", "defaultPauseTimeMax", "roamingPauseTime" })
public AttractionPointRoamingStrategy(long defaultPauseTimeMin, long defaultPauseTimeMax, long roamingPauseTime) {
super(defaultPauseTimeMin, defaultPauseTimeMax);
this.roamingPauseTime = roamingPauseTime;
}
@Override
......@@ -88,8 +91,8 @@ public class AttractionPointRoamingStrategy extends AbstractAttractionBasedAssig
this.roamingStates.put(comp, roamingTransitionState.PAUSE);
// schedule roaming
long roamingPauseTime = (long) (rnd.nextDouble() * Time.MINUTE * 5) + Time.MINUTE * 5;
Event.scheduleWithDelay(roamingPauseTime, this, comp, 0);
long pause = (long) Math.max(0, rnd.nextGaussian() * (roamingPauseTime / 3)) + roamingPauseTime;
Event.scheduleWithDelay(pause, this, comp, 0);
}
private void roamAroundAttractionPoint(SimLocationActuator comp) {
......
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