Package org.bigraphs.framework.core
Class ElementaryBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>>
java.lang.Object
org.bigraphs.framework.core.BigraphDelegator<S>
org.bigraphs.framework.core.ElementaryBigraph<S>
- Type Parameters:
S- the signature type
- All Implemented Interfaces:
Bigraph<S>,EcoreBigraph<S>,EcoreBigraphExt,HasSignature<S>
- Direct Known Subclasses:
DiscreteIon,Linkings.Closure,Linkings.IdentityEmpty,Linkings.Substitution,Placings.Barren,Placings.Join,Placings.Merge,Placings.Permutation
public abstract class ElementaryBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>>
extends BigraphDelegator<S>
implements EcoreBigraph<S>
Base class for the elementary building blocks of Ecore-based bigraphs.
Elementary bigraphs serve as units for constructing larger and more complex bigraphs via composition.
- Author:
- Dominik Grzelak
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bigraphs.framework.core.EcoreBigraph
EcoreBigraph.Stub<S extends AbstractEcoreSignature<?>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.emf.ecore.EObjectprotected org.eclipse.emf.ecore.EPackageFields inherited from class org.bigraphs.framework.core.BigraphDelegator
bigraphDelegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <C extends Control<?,?>>
booleanareConnected(BigraphEntity.NodeEntity<C> place1, BigraphEntity.NodeEntity<C> place2) Check if two nodes are connected to each other.List<BigraphEntity<?>> Returns all places of the bigraph, i.e., roots, nodes and sites.List<BigraphEntity<?>> getChildrenOf(BigraphEntity<?> node) Returns the set of children of a given node (including sites).getEdges()org.eclipse.emf.ecore.EObjectReturn the Ecore-based instance model of a bigraph object or signature object.intgetLevelOf(BigraphEntity<?> place) Get the depth of a place entity in the place graph (i.e., a tree).getLinkOfPoint(BigraphEntity<?> point) Returns the link of a bigraph's point type.org.eclipse.emf.ecore.EPackageReturn the metamodel of a bigraph object or a signature object.<C extends Control<?,?>>
BigraphEntity.NodeEntity<C> Always returnsnull, since elementary bigraphs are node-free bigraphs<C extends Control<?,?>>
Collection<BigraphEntity.NodeEntity<C>> getNodes()List<BigraphEntity<?>> getOpenNeighborhoodOfVertex(BigraphEntity<?> node) Gets the neighborhood of the given node of the place graph.getParent(BigraphEntity<?> node) Get the parent of a bigraph's place.getPointsFromLink(BigraphEntity.Link linkEntity) Get all point entities (i.e., ports and inner names) of a link entity (i.e., edges and outer names).<C extends Control<?,?>>
intgetPortCount(BigraphEntity.NodeEntity<C> node) Get the number of "blocked/occupied" ports by links of a node.getPorts(BigraphEntity<?> node) Return all ports of a node.getRoots()getSiblingsOfInnerName(BigraphEntity.InnerName innerName) Returns all siblings of an inner name.List<BigraphEntity<?>> getSiblingsOfNode(BigraphEntity<?> node) Returns all siblings of the given node of the current bigraph.getSites()getTopLevelRoot(BigraphEntity node) booleanbooleanisParentOf(BigraphEntity<?> node, BigraphEntity<?> possibleParent) A recursive function that checks, whether the given node haspossibleParentas parent.booleanMethods inherited from class org.bigraphs.framework.core.BigraphDelegator
getBigraphDelegate, getSignatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bigraphs.framework.core.Bigraph
getIncidentLinksOf, getInnerFace, getOuterFace, getSupport, isActive, isActiveAtNode, isActiveAtSite, isDiscrete, isEpimorphic, isGround, isGuarding, isLean, isMonomorphic, isPrimeMethods inherited from interface org.bigraphs.framework.core.EcoreBigraph
getEMetaModelData, getSignature, isBEdge, isBInnerName, isBLink, isBNode, isBOuterName, isBPlace, isBPoint, isBPort, isBRoot, isBSite, isIndexable, isNameable, isOfEClass
-
Field Details
-
metaModelPackage
protected org.eclipse.emf.ecore.EPackage metaModelPackage -
instanceModel
protected org.eclipse.emf.ecore.EObject instanceModel
-
-
Constructor Details
-
ElementaryBigraph
-
-
Method Details
-
isPlacing
public boolean isPlacing() -
isLinking
public boolean isLinking() -
getMetaModel
public org.eclipse.emf.ecore.EPackage getMetaModel()Description copied from interface:EcoreBigraphExtReturn the metamodel of a bigraph object or a signature object.It is a metamodel that either extends the base bigraph metamodel or the base signature metamodel.
- Specified by:
getMetaModelin interfaceEcoreBigraphExt- Returns:
- the metamodel in Ecore format
- See Also:
-
getInstanceModel
public org.eclipse.emf.ecore.EObject getInstanceModel()Description copied from interface:EcoreBigraphExtReturn the Ecore-based instance model of a bigraph object or signature object.- Specified by:
getInstanceModelin interfaceEcoreBigraphExt- Returns:
- the instance model in Ecore format
-
getAllPlaces
Description copied from interface:BigraphReturns all places of the bigraph, i.e., roots, nodes and sites.- Specified by:
getAllPlacesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getAllPlacesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Returns:
- all places of the bigraph
-
getAllLinks
- Specified by:
getAllLinksin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getAllLinksin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getRoots
- Specified by:
getRootsin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getRootsin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getNodes
- Specified by:
getNodesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getNodesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getSites
- Specified by:
getSitesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getSitesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getOuterNames
- Specified by:
getOuterNamesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getOuterNamesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getInnerNames
- Specified by:
getInnerNamesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getInnerNamesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getEdges
- Specified by:
getEdgesin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getEdgesin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getPortCount
Description copied from interface:BigraphGet the number of "blocked/occupied" ports by links of a node. Check with the control's arity.- Specified by:
getPortCountin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getPortCountin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the node- Returns:
- the port count of the node which are already used by links
-
isParentOf
Description copied from interface:BigraphA recursive function that checks, whether the given node haspossibleParentas parent. This means thatpossibleParentmust not necessarily be the direct parent, but can also be a parent higher in the hierarchy.- Specified by:
isParentOfin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
isParentOfin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the node to check against the parentpossibleParentpossibleParent- the possible parent to check againstnode- Returns:
true, ifpossibleParentis directly or indirectly the parent ofnode, otherwisefalse
-
getParent
Description copied from interface:BigraphGet the parent of a bigraph's place. Passing a root as argument will always returnnull.- Specified by:
getParentin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getParentin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- a place of this bigraph- Returns:
- the parent of the given place, or
null
-
getLinkOfPoint
Description copied from interface:BigraphReturns the link of a bigraph's point type.- Specified by:
getLinkOfPointin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getLinkOfPointin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
point- a point of the bigraph- Returns:
- returns the link that connects the point a
null
-
getLevelOf
Description copied from interface:BigraphGet the depth of a place entity in the place graph (i.e., a tree). The depth of a root node is always 0.- Specified by:
getLevelOfin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getLevelOfin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
place- the place node in question to compute its depth- Returns:
- the depth of the given place entity of this bigraph
-
getSiblingsOfInnerName
public Collection<BigraphEntity.InnerName> getSiblingsOfInnerName(BigraphEntity.InnerName innerName) Description copied from interface:BigraphReturns all siblings of an inner name. The collection will not contain any port.- Specified by:
getSiblingsOfInnerNamein interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getSiblingsOfInnerNamein classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
innerName- the inner name who's siblings should be returned- Returns:
- the siblings connected to
innerName
-
getNodeOfPort
Always returnsnull, since elementary bigraphs are node-free bigraphs- Specified by:
getNodeOfPortin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getNodeOfPortin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Type Parameters:
C- not considered- Parameters:
port- not considered- Returns:
nullis returned in every case
-
getPointsFromLink
Description copied from interface:BigraphGet all point entities (i.e., ports and inner names) of a link entity (i.e., edges and outer names).- Specified by:
getPointsFromLinkin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getPointsFromLinkin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
linkEntity- the link entity who's connections shall be returned- Returns:
- collection of points connected to the link entity
-
getSiblingsOfNode
Description copied from interface:BigraphReturns all siblings of the given node of the current bigraph. The node itself is not included.- Specified by:
getSiblingsOfNodein interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getSiblingsOfNodein classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the node whoms sibling should be returned- Returns:
- siblings of
node
-
getChildrenOf
Description copied from interface:BigraphReturns the set of children of a given node (including sites).
If the node has no children, then an empty set is returned.- Specified by:
getChildrenOfin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getChildrenOfin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the node whose children should be returned- Returns:
- a set of children of the given node
-
getPorts
Description copied from interface:BigraphReturn all ports of a node. If the node's control has arity 0, then the list will always be empty. If no link is attached to a port, the list will also be empty.- Specified by:
getPortsin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getPortsin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the node who's ports shall be returned- Returns:
- all ports of a node
-
areConnected
public final <C extends Control<?,?>> boolean areConnected(BigraphEntity.NodeEntity<C> place1, BigraphEntity.NodeEntity<C> place2) Description copied from interface:BigraphCheck if two nodes are connected to each other. The method considers connections by edges and outer names.- Specified by:
areConnectedin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
areConnectedin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
place1- left nodeplace2- right node- Returns:
- true, if the two nodes are connected by an edge or outer name
-
getOpenNeighborhoodOfVertex
Description copied from interface:BigraphGets the neighborhood of the given node of the place graph. The neighborhood is the set containing the its children and its parent (without the node in question itself).- Specified by:
getOpenNeighborhoodOfVertexin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getOpenNeighborhoodOfVertexin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Parameters:
node- the nodes who's neighborhood should be returned- Returns:
- the neighborhood of the node of the place graph
-
getTopLevelRoot
- Specified by:
getTopLevelRootin interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Overrides:
getTopLevelRootin classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-