core
Class SimScenario

java.lang.Object
  extended by core.SimScenario
All Implemented Interfaces:
java.io.Serializable

public class SimScenario
extends java.lang.Object
implements java.io.Serializable

A simulation scenario used for getting and storing the settings of a simulation run.

See Also:
Serialized Form

Field Summary
static java.lang.String END_TIME_S
          end time -setting id ("endTime")
static java.lang.String GROUP_ID_S
          group id -setting id ("groupID")
static java.lang.String GROUP_NS
          namespace for host group settings ("Group")
static java.lang.String MOVEMENT_MODEL_S
          movement model class -setting id ("movementModel")
static java.lang.String NAME_S
          scenario name -setting id ("name")
static java.lang.String NROF_GROUPS_S
          number of host groups -setting id ("nrofHostGroups")
static java.lang.String NROF_HOSTS_S
          number of hosts in the group -setting id ("nrofHosts")
static java.lang.String ROUTER_S
          router class -setting id ("router")
static java.lang.String SCENARIO_NS
          namespace of scenario settings ("Scenario")
static java.lang.String SIM_CON_S
          simulate connections -setting id ("simulateConnections")
static java.lang.String TRANSMIT_RANGE_S
          transmit range -setting id ("transmitRange")
static java.lang.String TRANSMIT_SPEED_S
          transmit speed -setting id ("transmitSpeed")
static java.lang.String UP_INT_S
          update interval -setting id ("updateInterval")
 
Constructor Summary
SimScenario()
          Creates a scenario based on Settings object.
 
Method Summary
 void addConnectionListener(ConnectionListener cl)
          Adds a new connection listener for all nodes
 void addMessageListener(MessageListener ml)
          Adds a new message listener for all nodes
 void addMovementListener(MovementListener ml)
          Adds a new movement listener for all nodes
 void addUpdateListener(UpdateListener ul)
          Adds a new update listener for the world
 void createHosts()
          Creates hosts for the scenario
 double getEndTime()
          Returns simulation's end time
 ExternalEventsQueue getExternalEvents()
          Returns the external events of this scenario or null if there aren't any
 java.util.List<DTNHost> getHosts()
          Returns the list of nodes for this scenario.
 SimMap getMap()
          Returns the SimMap this scenario uses, or null if scenario doesn't use any map
 double getMaxHostRange()
          Returns how long range the hosts' radios have
 java.lang.String getName()
          Returns the name of the simulation run
 double getUpdateInterval()
          Returns update interval (simulated seconds) of the simulation
 java.util.List<UpdateListener> getUpdateListeners()
          Returns the list of registered update listeners
 int getWorldSizeX()
          Returns the width of the world
 int getWorldSizeY()
          Returns the height of the world
 boolean simulateConnections()
          Returns true if connections should be simulated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCENARIO_NS

public static final java.lang.String SCENARIO_NS
namespace of scenario settings ("Scenario")

See Also:
Constant Field Values

NROF_GROUPS_S

public static final java.lang.String NROF_GROUPS_S
number of host groups -setting id ("nrofHostGroups")

See Also:
Constant Field Values

NAME_S

public static final java.lang.String NAME_S
scenario name -setting id ("name")

See Also:
Constant Field Values

END_TIME_S

public static final java.lang.String END_TIME_S
end time -setting id ("endTime")

See Also:
Constant Field Values

UP_INT_S

public static final java.lang.String UP_INT_S
update interval -setting id ("updateInterval")

See Also:
Constant Field Values

SIM_CON_S

public static final java.lang.String SIM_CON_S
simulate connections -setting id ("simulateConnections")

See Also:
Constant Field Values

GROUP_NS

public static final java.lang.String GROUP_NS
namespace for host group settings ("Group")

See Also:
Constant Field Values

GROUP_ID_S

public static final java.lang.String GROUP_ID_S
group id -setting id ("groupID")

See Also:
Constant Field Values

NROF_HOSTS_S

public static final java.lang.String NROF_HOSTS_S
number of hosts in the group -setting id ("nrofHosts")

See Also:
Constant Field Values

TRANSMIT_RANGE_S

public static final java.lang.String TRANSMIT_RANGE_S
transmit range -setting id ("transmitRange")

See Also:
Constant Field Values

TRANSMIT_SPEED_S

public static final java.lang.String TRANSMIT_SPEED_S
transmit speed -setting id ("transmitSpeed")

See Also:
Constant Field Values

MOVEMENT_MODEL_S

public static final java.lang.String MOVEMENT_MODEL_S
movement model class -setting id ("movementModel")

See Also:
Constant Field Values

ROUTER_S

public static final java.lang.String ROUTER_S
router class -setting id ("router")

See Also:
Constant Field Values
Constructor Detail

SimScenario

public SimScenario()
Creates a scenario based on Settings object.

Method Detail

getName

public java.lang.String getName()
Returns the name of the simulation run

Returns:
the name of the simulation run

simulateConnections

public boolean simulateConnections()
Returns true if connections should be simulated

Returns:
true if connections should be simulated (false if not)

getWorldSizeX

public int getWorldSizeX()
Returns the width of the world

Returns:
the width of the world

getWorldSizeY

public int getWorldSizeY()
Returns the height of the world

Returns:
the height of the world

getEndTime

public double getEndTime()
Returns simulation's end time

Returns:
simulation's end time

getUpdateInterval

public double getUpdateInterval()
Returns update interval (simulated seconds) of the simulation

Returns:
update interval (simulated seconds) of the simulation

getMaxHostRange

public double getMaxHostRange()
Returns how long range the hosts' radios have

Returns:
Range in meters

getExternalEvents

public ExternalEventsQueue getExternalEvents()
Returns the external events of this scenario or null if there aren't any

Returns:
External events or null

getMap

public SimMap getMap()
Returns the SimMap this scenario uses, or null if scenario doesn't use any map

Returns:
SimMap or null if no map is used

addConnectionListener

public void addConnectionListener(ConnectionListener cl)
Adds a new connection listener for all nodes

Parameters:
cl - The listener

addMessageListener

public void addMessageListener(MessageListener ml)
Adds a new message listener for all nodes

Parameters:
ml - The listener

addMovementListener

public void addMovementListener(MovementListener ml)
Adds a new movement listener for all nodes

Parameters:
ml - The listener

addUpdateListener

public void addUpdateListener(UpdateListener ul)
Adds a new update listener for the world

Parameters:
ul - The listener

getUpdateListeners

public java.util.List<UpdateListener> getUpdateListeners()
Returns the list of registered update listeners

Returns:
the list of registered update listeners

createHosts

public void createHosts()
Creates hosts for the scenario


getHosts

public java.util.List<DTNHost> getHosts()
Returns the list of nodes for this scenario.

Returns:
the list of nodes for this scenario.