public class World
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEF_RANDOMIZE_UPDATES
should the update order of nodes be randomized -setting's default value
(true)
|
static java.lang.String |
OPTIMIZATION_SETTINGS_NS
name space of optimization settings ("Optimization")
|
static java.lang.String |
RANDOMIZE_UPDATES_S
Should the order of node updates be different (random) within every
update step -setting id ("randomizeUpdateOrder").
|
static java.lang.String |
SIMULATE_CON_ONCE_S
Should the connectivity simulation be stopped after one round
-setting id ("simulateConnectionsOnce").
|
| Constructor and Description |
|---|
World(java.util.List<DTNHost> hosts,
int sizeX,
int sizeY,
double updateInterval,
java.util.List<UpdateListener> updateListeners,
boolean simulateConnections,
java.util.List<EventQueue> eventQueues)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelSim()
Asynchronously cancels the currently running simulation
|
java.util.List<DTNHost> |
getHosts()
Returns the hosts in a list
|
DTNHost |
getNodeByAddress(int address)
Returns a node from the world by its address
|
int |
getSizeX()
Returns the x-size (width) of the world
|
int |
getSizeY()
Returns the y-size (height) of the world
|
void |
scheduleUpdate(double simTime)
Schedules an update request to all nodes to happen at the specified
simulation time.
|
void |
setNextEventQueue()
Goes through all event Queues and sets the
event queue that has the next event.
|
void |
update()
Update (move, connect, disconnect etc.) all hosts in the world.
|
void |
warmupMovementModel(double time)
Moves hosts in the world for the time given time initialize host
positions properly.
|
public static final java.lang.String OPTIMIZATION_SETTINGS_NS
public static final java.lang.String RANDOMIZE_UPDATES_S
DEF_RANDOMIZE_UPDATES.public static final boolean DEF_RANDOMIZE_UPDATES
public static final java.lang.String SIMULATE_CON_ONCE_S
public World(java.util.List<DTNHost> hosts, int sizeX, int sizeY, double updateInterval, java.util.List<UpdateListener> updateListeners, boolean simulateConnections, java.util.List<EventQueue> eventQueues)
public void warmupMovementModel(double time)
-time before
calling this method.time - The total time (seconds) to movepublic void setNextEventQueue()
public void update()
public void cancelSim()
public java.util.List<DTNHost> getHosts()
public int getSizeX()
public int getSizeY()
public DTNHost getNodeByAddress(int address)
address - The address of the nodepublic void scheduleUpdate(double simTime)
simTime - The time of the update