vanetsim.scenario
Class Scenario

java.lang.Object
  extended by vanetsim.scenario.Scenario

public final class Scenario
extends java.lang.Object

A scenario saves the vehicles and events.


Method Summary
static Scenario getInstance()
          Gets the single instance of this scenario.
 boolean getReadyState()
          Returns if the scenario is currently being loaded.
 java.lang.String getScenarioName()
           
 void initNewScenario()
          Initializes a new (empty) scenario.
 void load(java.io.File file, boolean zip)
          Load a scenario.
 void save(java.io.File file, boolean zip)
          Save the scenario.
 void setReadyState(boolean ready)
          Sets the ready state of the scenario.
 void setScenarioName(java.lang.String scenarioName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Scenario getInstance()
Gets the single instance of this scenario.

Returns:
single instance of this scenario

initNewScenario

public void initNewScenario()
Initializes a new (empty) scenario.


load

public void load(java.io.File file,
                 boolean zip)
Load a scenario.

Parameters:
file - the file to load
zip - true if the file given is zipped, else false

setReadyState

public void setReadyState(boolean ready)
Sets the ready state of the scenario.

Parameters:
ready - true to signal that this scenario is ready with loading, else false

save

public void save(java.io.File file,
                 boolean zip)
Save the scenario.

Parameters:
file - the file in which to save
zip - if true, file is saved in a compressed zip file (extension .zip is added to file!). If false, no compression is made.

getReadyState

public boolean getReadyState()
Returns if the scenario is currently being loaded. While loading, simulation and rendering should not be done because not all simulation elements are already existing!

Returns:
true if loading has finished, else false

getScenarioName

public java.lang.String getScenarioName()

setScenarioName

public void setScenarioName(java.lang.String scenarioName)