Commit 6ef17f00 authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Add target offset of Gauss(25) to non-radius APs

parent 1975ab4a
......@@ -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.getRadius() / 3,
rand.nextGaussian() * newAssignment.getRadius() / 3);
rand.nextGaussian() * apRadius / 3,
rand.nextGaussian() * apRadius / 3);
destination.add(offset);
// Check constraints
if (destination.getX() < 0.0
......
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