|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmovement.MovementModel
movement.MapBasedMovement
public class MapBasedMovement
Map based movement model which gives out Paths that use the roads of a SimMap.
Field Summary | |
---|---|
static java.lang.String |
FILE_S
map file -setting id ("mapFile") |
protected MapNode |
lastMapNode
node where the last path ended or node next to intial placement |
static java.lang.String |
MAP_BASE_MOVEMENT_NS
map based movent model's settings namespace ("MapBasedMovement") |
static java.lang.String |
MAP_SELECT_S
Per node group setting for selecting map node types that are OK for this node group to traverse trough. |
static java.lang.String |
NROF_FILES_S
number of map files -setting id ("nrofMapFiles") |
Fields inherited from class movement.MovementModel |
---|
DEF_SPEEDS, DEF_WAIT_TIMES, MOVEMENT_MODEL_NS, rng, RNG_SEED, SPEED, WAIT_TIME, WORLD_SIZE |
Constructor Summary | |
---|---|
protected |
MapBasedMovement(MapBasedMovement mbm)
Copyconstructor. |
|
MapBasedMovement(Settings settings)
Creates a new MapBasedMovement based on a Settings object's settings. |
|
MapBasedMovement(Settings settings,
SimMap newMap,
int nrofMaps)
Creates a new MapBasedMovement based on a Settings object's settings but with different SimMap |
Method Summary | |
---|---|
Coord |
getInitialLocation()
Returns a (random) coordinate that is between two adjacent MapNodes |
SimMap |
getMap()
Returns the SimMap this movement model uses |
protected int[] |
getOkMapNodeTypes()
Returns map node types that are OK for this movement model in an array or null if all values are considered ok |
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). |
MapBasedMovement |
replicate()
Creates a replicate of the movement model. |
protected MapNode |
selectRandomOkNode(java.util.List<MapNode> nodes)
Selects and returns a random node that is OK from a list of nodes. |
Methods inherited from class movement.MovementModel |
---|
generateSpeed, generateWaitTime, getMaxX, getMaxY, isActive, nextPathAvailable, reset, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected MapNode lastMapNode
public static final java.lang.String MAP_BASE_MOVEMENT_NS
public static final java.lang.String NROF_FILES_S
public static final java.lang.String FILE_S
public static final java.lang.String MAP_SELECT_S
FILE_S
). If setting is not defined, all map nodes are
considered OK.
Constructor Detail |
---|
public MapBasedMovement(Settings settings)
settings
- The Settings object where the settings are read frompublic MapBasedMovement(Settings settings, SimMap newMap, int nrofMaps)
settings
- The Settings object where the settings are read fromnewMap
- The SimMap to usenrofMaps
- How many map "files" are in the mapprotected MapBasedMovement(MapBasedMovement mbm)
mbm
- The MapBasedMovement object to base the new object toMethod Detail |
---|
public Coord getInitialLocation()
getInitialLocation
in class MovementModel
protected int[] getOkMapNodeTypes()
public Path getPath()
MovementModel
getPath
in class MovementModel
protected MapNode selectRandomOkNode(java.util.List<MapNode> nodes)
nodes
- The list of nodes to choose from.
public SimMap getMap()
public MapBasedMovement replicate()
MovementModel
replicate
in class MovementModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |