MATES 3.0-rc2

org.mates.sim.models.mobility
Class RandomWalkingMobilityModel

java.lang.Object
  extended byorg.mates.sim.models.mobility.RandomWalkingMobilityModel
All Implemented Interfaces:
MobilityModel

public class RandomWalkingMobilityModel
extends java.lang.Object
implements MobilityModel

A mobility model that moves a host randomly. Each moveHost() call will first choose a new direction for the host. This will either be straight ahead (1/3 probability), DIRECTION_DELTA degrees counterclockwise (1/3 probability), or DIRECTION_DELTA degrees clockwise (1/3 probaility). Then, the host is moved forward in its current direction a distance of SPEED. By default, if a host's movement will disconnect the graph it is not moved.

Hosts using this link model must have a position of type Position2D.

Author:
Evan Sultanik

Field Summary
static double DIRECTION_DELTA
           
static double SPEED
           
 
Constructor Summary
RandomWalkingMobilityModel()
          Default constructor; connectivity of the network will not be preserved.
RandomWalkingMobilityModel(boolean preserve_connectivity)
           
 
Method Summary
 void moveHost(Host host)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_DELTA

public static double DIRECTION_DELTA

SPEED

public static double SPEED
Constructor Detail

RandomWalkingMobilityModel

public RandomWalkingMobilityModel()
Default constructor; connectivity of the network will not be preserved.


RandomWalkingMobilityModel

public RandomWalkingMobilityModel(boolean preserve_connectivity)
Parameters:
preserve_connectivity - if true, hosts will not be moved if their movement will disconnect the network. Note that this is at a huge expense to performance.
Method Detail

moveHost

public void moveHost(Host host)
Specified by:
moveHost in interface MobilityModel

MATES 3.0-rc2

Submit a bug or request a feature
http://mates.sourceforge.net/

Copyright 2004 Evan Sultanik