Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
26bc14b8
Commit
26bc14b8
authored
Dec 02, 2020
by
Julian Zobel
Browse files
Pause time for AP roaming strategy
parent
96cc40f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/transition/AttractionPointRoamingStrategy.java
View file @
26bc14b8
...
...
@@ -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
(
roamingPauseTim
e
,
this
,
comp
,
0
);
long
pause
=
(
long
)
Math
.
max
(
0
,
rnd
.
nextGaussian
()
*
(
roamingPauseTime
/
3
))
+
roamingPauseTime
;
Event
.
scheduleWithDelay
(
paus
e
,
this
,
comp
,
0
);
}
private
void
roamAroundAttractionPoint
(
SimLocationActuator
comp
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment