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
01e48533
Commit
01e48533
authored
Feb 10, 2020
by
Julian Zobel
Browse files
Viz updates and bug fixes
parent
e8df1a35
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/ModularMovementModelViz.java
View file @
01e48533
...
...
@@ -20,7 +20,6 @@
package
de.tud.kom.p2psim.impl.topology.movement.modularosm
;
import
java.awt.AlphaComposite
;
import
java.awt.BasicStroke
;
import
java.awt.Color
;
import
java.awt.Composite
;
...
...
@@ -68,9 +67,9 @@ public class ModularMovementModelViz extends JComponent
protected
boolean
showAttractionPoints
=
true
;
protected
boolean
showNodePositions
=
tru
e
;
protected
boolean
showNodePositions
=
fals
e
;
protected
boolean
showTrajectories
=
tru
e
;
protected
boolean
showTrajectories
=
fals
e
;
protected
boolean
setupCalculatesTrajectories
=
false
;
...
...
@@ -304,10 +303,11 @@ public class ModularMovementModelViz extends JComponent
protected
void
drawNodePosition
(
Graphics2D
g2
,
SimLocationActuator
comp
)
{
Point2D
pt
=
comp
.
getRealPosition
().
asPoint
();
g2
.
setColor
(
Color
.
GRAY
);
g2
.
fillOval
(
VisualizationInjector
.
scaleValue
(
pt
.
getX
())
-
NODE_SIZE
,
VisualizationInjector
.
scaleValue
(
pt
.
getY
())
-
NODE_SIZE
,
NODE_SIZE
*
2
,
NODE_SIZE
*
2
);
VisualizationInjector
.
scaleValue
(
pt
.
getY
())
-
NODE_SIZE
,
NODE_SIZE
*
2
,
NODE_SIZE
*
2
);
}
protected
void
setMovementModel
(
ModularMovementModel
model
)
...
...
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/SocialGroupMovementModel.java
View file @
01e48533
...
...
@@ -110,10 +110,12 @@ public class SocialGroupMovementModel extends ModularMovementModel {
// strategy
for
(
SimLocationActuator
ms
:
moveableHosts
)
{
attractionAssigment
.
addComponent
(
ms
);
if
(
placeNodesAtAP
)
ms
.
updateCurrentLocation
(
attractionAssigment
.
getAssignment
(
ms
));
if
(
placeNodesAtAP
)
{
AttractionPoint
assignment
=
attractionAssigment
.
getAssignment
(
ms
);
double
apRadius
=
(
assignment
.
hasRadius
()
?
Math
.
max
(
assignment
.
getRadius
(),
25.0
)
:
25.0
);
ms
.
updateCurrentLocation
(
this
.
addGaussianOffsetToPosition
(
new
PositionVector
(
assignment
),
apRadius
/
3
));
}
}
setTimeBetweenMoveOperations
(
timeBetweenMoveOperation
);
...
...
@@ -125,8 +127,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
}
}
/**
...
...
src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java
View file @
01e48533
...
...
@@ -29,14 +29,12 @@ import java.awt.Font;
import
java.awt.Frame
;
import
java.awt.Graphics
;
import
java.awt.Graphics2D
;
import
java.awt.RenderingHints
;
import
java.awt.Stroke
;
import
java.awt.Toolkit
;
import
java.awt.event.AWTEventListener
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.KeyEvent
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.awt.geom.Point2D
;
import
java.util.Collection
;
...
...
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