|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
A Graph
serves two roles in the STEM system. The first is as
the canonical data structure that is the representational framework for all
STEM simulations. In this form, a Graph
, with one exception,
matches the theoretical definition of a "graph" in that it has a set of
Node
s, a set of Edge
s between members of the Node
set, and a set of Label
s that label either a member of the
Node
set or a member of the Edge
set. The one exception is
that an additional set of Label
s designated as "graph labels"
exists. These Label
s function as "gloabl variables" and would
typically be used during a simulation to hold global state information (for
instance, parameters referenced by a Decorator
that control it's
computations on a graph-wide basis, an example might be a disease model that
can change the infectious rate it uses by referencing such a label).
The second role played by a Graph
is as a unit of composition
in a Model
. A Model
forms a tree of Graph
s
and Model
s. The Graph
instances are the leaves of the
tree while the Model
instances are the root and inner nodes of the
tree. In this role, a Graph
may not meet the theoretical
definition of a "graph". This means that it may only have a set of
Label
s or a set of Edge
s, and no Node
s. This
"graph fragment" allows sets of Label
s and Edge
s to be
defined and then later combined with an existing Graph
that
does have Node
s. This combination is specified by adding the graph
fragment to a Model
instance. When the canonical Graph
is created, the Label
s and Edge
s are "resolved" by matching
their target URI
(s) with those of the Node
s in the
canonical Graph
under construction. Any such Label
s
or Edge
s that are unresolved are recorded as
UnresolvedIdentifiable
s.
The Graph
has containment relationships for
Node
s, Edge
s and the labels on nodes (i.e.,
NodeLabel
s). These support the graph fragment role by allowing a
Graph
to contain any of the three without the others. The
Label
s on Edge
s are contained by the Edge
as it is
not possible to have such a Label
without the Edge
. Only one
such Label
is allowed per Edge
.
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.
Edge
,
Node
,
Label
,
Model
,
Scenario
Field Summary | |
---|---|
static java.lang.String |
URI_TYPE_GRAPH_SEGMENT
This is the segment of the type URI that prefixes all other segments in a graph URI. |
Method Summary | |
---|---|
void |
addDynamicLabel(DynamicLabel dynamiclabel)
Add the Dynamic Label into the graph. |
void |
addGraph(Graph graph)
Add the Edges, Nodes and Labels to this Graph. |
org.eclipse.emf.common.util.EList<Decorator> |
getDecorators()
|
org.eclipse.emf.common.util.EList<DynamicLabel> |
getDynamicLabels()
This collection of Labels contains references to ALL of the dynamic labels in the Graph. |
Edge |
getEdge(org.eclipse.emf.common.util.URI uri)
Get the Edge from the graph. |
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Edge> |
getEdges()
|
Label |
getGraphLabel(org.eclipse.emf.common.util.URI uri)
Put the Graph Label into the graph. |
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Label> |
getGraphLabels()
|
Node |
getNode(org.eclipse.emf.common.util.URI uri)
Get the Node from the graph. |
NodeLabel |
getNodeLabel(org.eclipse.emf.common.util.URI uri)
Get the Node Label from the graph. |
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,NodeLabel> |
getNodeLabels()
|
org.eclipse.emf.common.util.EList<NodeLabel> |
getNodeLabelsByTypeURI(org.eclipse.emf.common.util.URI typeURI)
|
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Node> |
getNodes()
|
int |
getNumDynamicLabels()
Return the number of Dynamic Labels in this Graph. |
int |
getNumEdges()
Return the number of Edges in this Graph. |
int |
getNumGraphLabels()
Return the number of Graph Labels in this Graph. |
int |
getNumNodeLabels()
Return the number of Node Labels in this Graph. |
int |
getNumNodes()
Return the number of Nodes in this Graph. |
org.eclipse.emf.common.util.EList<UnresolvedIdentifiable> |
getUnresolvedIdentifiables()
|
void |
putEdge(Edge edge)
Put the Edge into the graph. |
void |
putGraphLabel(Label label)
Put the Graph Label into the graph. |
void |
putNode(Node node)
Put the Node into the graph. |
void |
putNodeLabel(NodeLabel label)
Put the Node Label into the graph. |
void |
switchToNextValue()
Make all of the dynamic labels in the model switch to their "next" value. |
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_GRAPH_SEGMENT
Method Detail |
---|
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Edge> getEdges()
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Node> getNodes()
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,Label> getGraphLabels()
org.eclipse.emf.common.util.EMap<org.eclipse.emf.common.util.URI,NodeLabel> getNodeLabels()
org.eclipse.emf.common.util.EList<NodeLabel> getNodeLabelsByTypeURI(org.eclipse.emf.common.util.URI typeURI)
typeURI
- the type URI
of the desired node labels
NodeLabel
s that match a specific type URI
org.eclipse.emf.common.util.EList<DynamicLabel> getDynamicLabels()
switchToNextValue()
to find each of the labels that need to
switch.
org.eclipse.emf.common.util.EList<Decorator> getDecorators()
Decorator
s that decorate this Graph
void addGraph(Graph graph)
void putEdge(Edge edge)
Edge getEdge(org.eclipse.emf.common.util.URI uri)
void putNode(Node node)
Node getNode(org.eclipse.emf.common.util.URI uri)
void putNodeLabel(NodeLabel label)
NodeLabel getNodeLabel(org.eclipse.emf.common.util.URI uri)
void putGraphLabel(Label label)
Label getGraphLabel(org.eclipse.emf.common.util.URI uri)
void addDynamicLabel(DynamicLabel dynamiclabel)
int getNumEdges()
int getNumNodes()
int getNumGraphLabels()
int getNumNodeLabels()
int getNumDynamicLabels()
org.eclipse.emf.common.util.EList<UnresolvedIdentifiable> getUnresolvedIdentifiables()
void switchToNextValue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |