Mobility models for ad-hoc networks
Brownian motion
The '+' simbol denotes the gravity center.
The '.' points are the reference locations of the nodes.
The "0" node is the target point, it is not animated.
public static Pos move_random(int node) { // performs the
calculations for the movement of a node
Pos n=(Pos)loc.get(new Integer(node));
int xi,yi;
xi=((int)((Math.random()-0.5)*3.0)) + n.x;
yi=((int)((Math.random()-0.5)*3.0)) + n.y;
Pos p=new Pos(xi,yi);
return p;
}
If you
have not the correct behavior, please let your browser to totally reload the contents of
this page. The complete source code of these applets is here.
Miguel Sanchez 1998
|