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
c4eb36b8
Commit
c4eb36b8
authored
Jun 04, 2020
by
Julian Zobel
Browse files
Areas for Attraction Points
Group Forming bugfix: now correctly disables group movement
parent
ff821148
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/attraction/AttractionPoint.java
View file @
c4eb36b8
...
...
@@ -20,19 +20,11 @@
package
de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction
;
import
java.lang.annotation.Annotation
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.jboss.logging.annotations.Pos
;
import
org.jboss.logging.annotations.Transform
;
import
de.tud.kom.p2psim.impl.topology.movement.modularosm.IAttractionBasedMovementAnalyzer
;
import
de.tud.kom.p2psim.impl.topology.movement.modularosm.ISocialGroupMovementAnalyzer
;
import
de.tud.kom.p2psim.impl.topology.util.PositionVector
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor
;
import
de.tudarmstadt.maki.simonstrator.api.Randoms
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.IAttractionPoint
;
import
de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor
;
...
...
@@ -53,13 +45,13 @@ public class AttractionPoint extends BasicAttractionPoint {
protected
long
pauseTimeMax
=
-
1
;
protected
double
weight
=
0
;
protected
double
radius
=
0
;
protected
double
area
=
1
;
@XMLConfigurableConstructor
({
"name"
,
"x"
,
"y"
})
public
AttractionPoint
(
String
name
,
double
x
,
double
y
)
{
this
(
name
,
new
PositionVector
(
x
,
y
));
}
public
AttractionPoint
(
String
name
,
PositionVector
posVec
)
{
super
(
name
,
posVec
);
...
...
@@ -81,7 +73,11 @@ public class AttractionPoint extends BasicAttractionPoint {
this
.
weight
=
weight
;
this
.
radius
=
radius
;
this
.
setPauseTime
(
pauseTimeMin
,
pauseTimeMax
);
this
.
setPauseTime
(
pauseTimeMin
,
pauseTimeMax
);
if
(
radius
>
0
)
{
this
.
area
=
Math
.
PI
*
Math
.
pow
(
radius
,
2
);
}
}
@Override
...
...
@@ -189,4 +185,8 @@ public class AttractionPoint extends BasicAttractionPoint {
public
String
toString
()
{
return
getName
()
+
" ("
+
getX
()
+
", "
+
getY
()
+
")"
+
" <"
+
getRadius
()
+
"> "
;
}
public
double
getArea
()
{
return
area
;
}
}
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/groups/groupforming/AbstractGroupForming.java
View file @
c4eb36b8
...
...
@@ -138,6 +138,11 @@ public abstract class AbstractGroupForming implements IGroupFormingBehavior {
stayDuration
.
put
(
host
.
getHost
().
getId
(),
new
Tuple
<
Long
,
Long
>(
0L
,
Time
.
getCurrentTime
()));
}
if
(!
enableGroups
)
{
return
;
}
for
(
int
g
=
0
;
g
<
maxNumberOfGroups
;
g
++)
{
long
delay
=
Math
.
max
(
Time
.
MINUTE
,
(
long
)
((
rand
.
nextDouble
()
*
(
Time
.
MINUTE
*
45
)
+
Time
.
MINUTE
)));
//System.out.println("("+g+") Init Group Formation Time " + Time.getFormattedTime(delay) );
...
...
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