|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmovement.MovementModel
public abstract class MovementModel
Superclass for all movement models. All subclasses must contain at least a
constructor with one Settings
parameter and also a copy-constructor.
They must also implement the replicate()
method, which should return
an instance of the movement model class with same parameters as the object
(immutable fields can be shared, but mutable fields must be copied).
To make a new movement model do something useful, also at least
getInitialLocation()
and getPath()
are worthwhile to
override.
Field Summary | |
---|---|
static double[] |
DEF_SPEEDS
default setting for speed distribution |
static double[] |
DEF_WAIT_TIMES
default setting for wait time distribution |
static java.lang.String |
MOVEMENT_MODEL_NS
MovementModel namespace (where world size and rng seed settings are looked from ("MovementModel") |
static java.lang.String |
RNG_SEED
movement models' rng seed -setting id ("rngSeed") |
static java.lang.String |
SPEED
node's speed CSV (min, max) -setting id ("speed") |
static java.lang.String |
WAIT_TIME
node's wait time CSV (min, max) -setting id ("waitTime") |
static java.lang.String |
WORLD_SIZE
world's size CSV (width, height) -setting id ("worldSize") |
Constructor Summary | |
---|---|
MovementModel()
Empty constructor for testing purposes. |
|
MovementModel(MovementModel mm)
Copyconstructor. |
|
MovementModel(core.Settings settings)
Creates a new MovementModel based on a Settings object's settings. |
Method Summary | |
---|---|
core.ModuleCommunicationBus |
getComBus()
Returns the module communication bus of this movement model (if any) |
abstract core.Coord |
getInitialLocation()
Returns a new initial placement for a node |
int |
getMaxX()
Returns the largest X coordinate value this model uses |
int |
getMaxY()
Returns the largest Y coordinate value this model uses |
abstract movement.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 |
isActive()
Returns true if this node is active at the moment (false if not) |
double |
nextPathAvailable()
Returns a sim time when the next path is available. |
abstract MovementModel |
replicate()
Creates a replicate of the movement model. |
static void |
reset()
Resets all static fields to default values |
double |
returnWaitTime()
returns the waiting time generated for the node's next location WAIT_TIME setting). |
void |
setComBus(core.ModuleCommunicationBus comBus)
Sets the module communication bus for this movement model |
java.lang.String |
toString()
Returns simply the name of the movement model class |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPEED
public static final java.lang.String WAIT_TIME
public static final double[] DEF_SPEEDS
public static final double[] DEF_WAIT_TIMES
public static final java.lang.String MOVEMENT_MODEL_NS
public static final java.lang.String WORLD_SIZE
public static final java.lang.String RNG_SEED
Constructor Detail |
---|
public MovementModel()
public MovementModel(core.Settings settings)
settings
- The Settings object where the settings are read frompublic MovementModel(MovementModel mm)
mm
- The MovementModel prototype to base the new object toMethod Detail |
---|
public int getMaxX()
public int getMaxY()
public double returnWaitTime()
WAIT_TIME
setting).
public abstract movement.Path getPath()
public abstract core.Coord getInitialLocation()
public boolean isActive()
public double nextPathAvailable()
WAIT_TIME
from now.
public void setComBus(core.ModuleCommunicationBus comBus)
comBus
- The communications bus to setpublic core.ModuleCommunicationBus getComBus()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract MovementModel replicate()
public static void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |