public class RandomWalk extends MovementModel implements SwitchableMovement
comBus, DEF_SPEEDS, DEF_WAIT_TIMES, host, maxSpeed, maxWaitTime, minSpeed, minWaitTime, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE| Constructor and Description |
|---|
RandomWalk(Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
Coord |
getInitialLocation()
Returns a possible (random) placement for a host
|
Coord |
getLastLocation()
Get the last location the getPath() of this movement model has returned
|
Path |
getPath()
Returns a new path by this movement model or null if no new path could
be constructed at the moment (node should wait where it is).
|
boolean |
isReady()
Checks if the movement model is finished doing its task and it's time to
switch to the next movement model.
|
RandomWalk |
replicate()
Creates a replicate of the movement model.
|
void |
setLocation(Coord lastWaypoint)
Tell the movement model what its current location is
|
generateSpeed, generateWaitTime, getComBus, getHost, getMaxX, getMaxY, isActive, nextPathAvailable, reset, setComBus, setHost, toStringpublic RandomWalk(Settings settings)
public Coord getInitialLocation()
getInitialLocation in class MovementModelpublic Path getPath()
MovementModelgetPath in class MovementModelpublic RandomWalk replicate()
MovementModelreplicate in class MovementModelpublic Coord getLastLocation()
SwitchableMovementgetLastLocation in interface SwitchableMovementpublic void setLocation(Coord lastWaypoint)
SwitchableMovementsetLocation in interface SwitchableMovementpublic boolean isReady()
SwitchableMovementisReady in interface SwitchableMovement