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
6ef17f00
Commit
6ef17f00
authored
Feb 14, 2017
by
Björn Richerzhagen
Browse files
Add target offset of Gauss(25) to non-radius APs
parent
1975ab4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/ModularMovementModel.java
View file @
6ef17f00
...
...
@@ -240,14 +240,18 @@ public class ModularMovementModel implements MovementModel, EventHandler, Attrac
*/
PositionVector
attractionCenter
=
(
PositionVector
)
newAssignment
;
PositionVector
destination
=
null
;
/*
* Even if an AP does not have a radius, we slightly offset
*/
double
apRadius
=
Math
.
max
(
newAssignment
.
getRadius
(),
25.0
);
int
tries
=
0
;
do
{
destination
=
new
PositionVector
(
attractionCenter
);
// Gaussian with std = 1 --> >99% of nodes
PositionVector
offset
=
new
PositionVector
(
rand
.
nextGaussian
()
*
newAssignment
.
get
Radius
()
/
3
,
rand
.
nextGaussian
()
*
newAssignment
.
get
Radius
()
/
3
);
rand
.
nextGaussian
()
*
ap
Radius
/
3
,
rand
.
nextGaussian
()
*
ap
Radius
/
3
);
destination
.
add
(
offset
);
// Check constraints
if
(
destination
.
getX
()
<
0.0
...
...
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