org.eclipse.ohf.stem.core.scenario
Interface Scenario

All Superinterfaces:
org.eclipse.emf.ecore.EObject, Identifiable, org.eclipse.emf.common.notify.Notifier, SanityChecker
All Known Implementing Classes:
ScenarioImpl

public interface Scenario
extends Identifiable

A Scenario combines all of the components required to create and execute a simulation. These are a Model, a Sequencer, and a set of Scenario specific Decorator's.

The Model contains the details of how to construct the canonical graph (see Graph. This graph is what the Scenario uses to represent the state of a simulation.

The Sequencer is used by the Scenario to determine the sequence of points in time through which the Scenario will step() as it computes successive simulation states.

The "scenario decorators" implement that part of the simulation computation that is specific to the Scenario.

A Scenario implements all of the logic necessary to sequence through each step of a simulation and can be executed outside of the Eclipse workbench.

This interface definition is also an "Annotated Java Interface" that defines one class in a UML "model". The UML class diagram for the model is in the documentation folder of the project. This file and the other interfaces in this Java package are processed by the Eclipse Modeling Framework (aka EMF http://org.eclipse/emf). to automatically generate an implementation of the model. EMF is documented in the book Eclipse Modeling Framework by Budinsky, et al.

See Also:
Model, Graph

Field Summary
static java.lang.String URI_TYPE_SCENARIO_SEGMENT
          This is the segment of the type URI that prefixes all other segments in a scenario URI.
 
Method Summary
 Graph getCanonicalGraph()
          The canonical Graph is created by the scenario's Model when the method initialize() is invoked.
 Model getModel()
          The Model contains all of the details required to construct the canonical graph that the scenario will use to represent the state of a simulation.
 org.eclipse.emf.common.util.EList<Decorator> getScenarioDecorators()
          The "scenario decorators" are the Decorator's that can "decorate" (i.e., modify) the canonical Graph after it has been generated by the Model.
 Sequencer getSequencer()
          The Sequencer is the component that determines the time of the simulation.
 void initialize()
          Create the canonical Graph and perform initialization steps required to sequence the scenario.
 java.lang.String produceTitle()
           
 void reset()
          Reset the state of the canonical Graph to its initial state.
 void setModel(Model value)
          Sets the value of the 'Model' reference.
 void setSequencer(Sequencer value)
          Sets the value of the 'Sequencer' reference.
 boolean step()
          Sequence the model by one simulation step.
 
Methods inherited from interface org.eclipse.ohf.stem.core.common.Identifiable
getDublinCore, getTypeURI, getURI, sane, setDublinCore, setTypeURI, setURI
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Field Detail

URI_TYPE_SCENARIO_SEGMENT

static final java.lang.String URI_TYPE_SCENARIO_SEGMENT
This is the segment of the type URI that prefixes all other segments in a scenario URI.

See Also:
Constant Field Values
Method Detail

getModel

Model getModel()
The Model contains all of the details required to construct the canonical graph that the scenario will use to represent the state of a simulation.

Returns:
the Scenario's Model.

setModel

void setModel(Model value)
Sets the value of the 'Model' reference.

Parameters:
value - the new value of the 'Model' reference.
See Also:
getModel()

getSequencer

Sequencer getSequencer()
The Sequencer is the component that determines the time of the simulation. It generates STEMTime values that are then used by the Decorator's to update the Label's in the canonical graph.


setSequencer

void setSequencer(Sequencer value)
Sets the value of the 'Sequencer' reference.

Parameters:
value - the new value of the 'Sequencer' reference.
See Also:
getSequencer()

getScenarioDecorators

org.eclipse.emf.common.util.EList<Decorator> getScenarioDecorators()
The "scenario decorators" are the Decorator's that can "decorate" (i.e., modify) the canonical Graph after it has been generated by the Model. Typically, these decorators are used to provide scenario specific initialization of a simulation independent of the more general initialization provided by the decorators in the Model.

For instance, in the case of a disease simulation, the model decorators would include one that implements a disease model. That decorator would have added labels to appropriate nodes to represent the state of the disease at specific geographic locations (likely most of the Nodes in the Graph). However, none of the disease states would (likely) include infected population members. The job of introducing the infected population members would be left up to a decorator contained in the scenario. Thus, one could reuse the same underlying Model in different Scenario's. Each Scenario, in turn, would contain a Decorator configured for a different infection starting point.

Returns:
the Scenario Decorators
See Also:
initialize(), getCanonicalGraph()

getCanonicalGraph

Graph getCanonicalGraph()
The canonical Graph is created by the scenario's Model when the method initialize() is invoked. This occurs either by a direct call or more typically in the step() method.

Returns:
the canonical graph, or null if the Scenario hasn't been initialized.

step

boolean step()
Sequence the model by one simulation step. This performs any initialization required to create the canonical Graph, if necessary.

Returns:
true if the sequence can continue, false if the sequence has completed.
See Also:
initialize()

reset

void reset()
Reset the state of the canonical Graph to its initial state. This does not delete and recreate the canonical graph.


initialize

void initialize()
Create the canonical Graph and perform initialization steps required to sequence the scenario. This method is called by step() when it needs to create the canonical Graph. It can be called before a call to step() to create the Graph.

See Also:
getCanonicalGraph()

produceTitle

java.lang.String produceTitle()
Returns:
the title of the scenario as specified by its DublinCore, or, if no title is defined, return the empty string.
See Also:
Identifiable.getDublinCore()