|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmovement.MovementModel
movement.MapBasedMovement
movement.HomeActivityMovement
public class HomeActivityMovement
A Class to model movement at home. If the node happens to be at some other location than its home, it first walks the shortest path home location and then stays there until morning. A node has only one home
Field Summary | |
---|---|
static java.lang.String |
HOME_LOCATIONS_FILE_SETTING
|
static java.lang.String |
STD_FOR_TIME_DIFF_SETTING
|
Fields inherited from class movement.MapBasedMovement |
---|
backAllowed, FILE_S, lastMapNode, MAP_BASE_MOVEMENT_NS, MAP_SELECT_S, maxPathLength, minPathLength, NROF_FILES_S |
Fields inherited from class movement.MovementModel |
---|
comBus, DEF_SPEEDS, DEF_WAIT_TIMES, maxSpeed, maxWaitTime, minSpeed, minWaitTime, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE |
Constructor Summary | |
---|---|
HomeActivityMovement(HomeActivityMovement proto)
Creates a new instance of HomeActivityMovement from a prototype |
|
HomeActivityMovement(Settings settings)
Creates a new instance of HomeActivityMovement |
Method Summary | |
---|---|
protected double |
generateWaitTime()
Generates and returns a suitable waiting time at the end of a path. |
Coord |
getHomeLocation()
|
Coord |
getInitialLocation()
Returns a (random) coordinate that is between two adjacent MapNodes |
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. |
MapBasedMovement |
replicate()
Creates a replicate of the movement model. |
void |
setLocation(Coord lastWaypoint)
Tell the movement model what its current location is |
Methods inherited from class movement.MapBasedMovement |
---|
getMap, getOkMapNodeTypes, selectRandomOkNode |
Methods inherited from class movement.MovementModel |
---|
generateSpeed, getComBus, getMaxX, getMaxY, isActive, nextPathAvailable, reset, setComBus, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOME_LOCATIONS_FILE_SETTING
public static final java.lang.String STD_FOR_TIME_DIFF_SETTING
Constructor Detail |
---|
public HomeActivityMovement(Settings settings)
settings
- public HomeActivityMovement(HomeActivityMovement proto)
proto
- Method Detail |
---|
public Coord getInitialLocation()
MapBasedMovement
getInitialLocation
in class MapBasedMovement
public Path getPath()
MovementModel
getPath
in class MapBasedMovement
protected double generateWaitTime()
MovementModel
MovementModel.WAIT_TIME
setting).
generateWaitTime
in class MovementModel
public MapBasedMovement replicate()
MovementModel
replicate
in class MapBasedMovement
public Coord getLastLocation()
SwitchableMovement
getLastLocation
in interface SwitchableMovement
getLastLocation
in class MapBasedMovement
SwitchableMovement
public boolean isReady()
SwitchableMovement
isReady
in interface SwitchableMovement
isReady
in class MapBasedMovement
SwitchableMovement
public void setLocation(Coord lastWaypoint)
SwitchableMovement
setLocation
in interface SwitchableMovement
setLocation
in class MapBasedMovement
SwitchableMovement
public Coord getHomeLocation()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |