|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Scenario
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.
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 |
---|
static final java.lang.String URI_TYPE_SCENARIO_SEGMENT
Method Detail |
---|
Model getModel()
Model
contains all of the details required to construct the
canonical graph that the scenario will use to represent the state of a
simulation.
Model
.void setModel(Model value)
Model
' reference.
value
- the new value of the 'Model' reference.getModel()
Sequencer getSequencer()
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.
void setSequencer(Sequencer value)
Sequencer
' reference.
value
- the new value of the 'Sequencer' reference.getSequencer()
org.eclipse.emf.common.util.EList<Decorator> getScenarioDecorators()
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.
initialize()
,
getCanonicalGraph()
Graph getCanonicalGraph()
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.
boolean step()
Graph
, if
necessary.
true
if the sequence can continue,
false
if the sequence has completed.initialize()
void reset()
Graph
to its initial state. This
does not delete and recreate the canonical graph.
void initialize()
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
.
getCanonicalGraph()
java.lang.String produceTitle()
DublinCore
,
or, if no title is defined, return the empty string.Identifiable.getDublinCore()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |