Class PureBigraph
java.lang.Object
org.bigraphs.framework.core.impl.pure.PureBigraph
- All Implemented Interfaces:
Bigraph<DefaultDynamicSignature>
,EcoreBigraph<DefaultDynamicSignature>
,EcoreBigraphExt
,HasSignature<DefaultDynamicSignature>
public class PureBigraph
extends Object
implements Bigraph<DefaultDynamicSignature>, EcoreBigraph<DefaultDynamicSignature>
This class is an Ecore-based model implementation of a pure bigraph.
A
PureBigraph
can be obtained by using a PureBigraphBuilder
.
The class directly implements the Bigraph
interface with DefaultDynamicSignature
as type for the signature.
The class represents an immutable data structure providing also some operations (e.g., get parent of node). The elements are stored separately in collections for easier access. The collections cannot be modified afterwards.
- Author:
- Dominik Grzelak
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bigraphs.framework.core.EcoreBigraph
EcoreBigraph.Stub<S extends AbstractEcoreSignature<?>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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.EObject
Return the Ecore-based instance model of a bigraph object or signature object.int
getLevelOf
(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.EPackage
Return the metamodel of a bigraph object or a signature object.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.List<BigraphEntity<?>>
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.Get the corresponding signature of the underlying bigraphgetSites()
getTopLevelRoot
(BigraphEntity<?> node) boolean
isParentOf
(BigraphEntity<?> node, BigraphEntity<?> possibleParent) A recursive function that checks, whether the given node haspossibleParent
as parent.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bigraphs.framework.core.Bigraph
getIncidentLinksOf, getInnerFace, getOuterFace, getSupport, isActive, isActiveAtNode, isActiveAtSite, isDiscrete, isEpimorphic, isGround, isGuarding, isLean, isMonomorphic, isPrime
Methods inherited from interface org.bigraphs.framework.core.EcoreBigraph
getEMetaModelData, isBEdge, isBInnerName, isBLink, isBNode, isBOuterName, isBPlace, isBPoint, isBPort, isBRoot, isBSite, isIndexable, isNameable, isOfEClass
-
Constructor Details
-
PureBigraph
-
-
Method Details
-
getMetaModel
public org.eclipse.emf.ecore.EPackage getMetaModel()Description copied from interface:EcoreBigraphExt
Return 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:
getMetaModel
in interfaceEcoreBigraphExt
- Returns:
- the metamodel in Ecore format
- See Also:
-
de.tudresden.inf.st.bigraphs.models.bigraphBaseModel.BigraphBaseModelPackage
-
getInstanceModel
public org.eclipse.emf.ecore.EObject getInstanceModel()Description copied from interface:EcoreBigraphExt
Return the Ecore-based instance model of a bigraph object or signature object.- Specified by:
getInstanceModel
in interfaceEcoreBigraphExt
- Returns:
- the instance model in Ecore format
-
getSignature
Description copied from interface:HasSignature
Get the corresponding signature of the underlying bigraph- Specified by:
getSignature
in interfaceBigraph<DefaultDynamicSignature>
- Specified by:
getSignature
in interfaceEcoreBigraph<DefaultDynamicSignature>
- Specified by:
getSignature
in interfaceHasSignature<DefaultDynamicSignature>
- Returns:
- the signature of the bigraph
-
getLevelOf
Description copied from interface:Bigraph
Get 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:
getLevelOf
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
place
- the place node in question to compute its depth- Returns:
- the depth of the given place entity of this bigraph
-
getOpenNeighborhoodOfVertex
Description copied from interface:Bigraph
Gets 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:
getOpenNeighborhoodOfVertex
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the nodes who's neighborhood should be returned- Returns:
- the neighborhood of the node of the place graph
-
getRoots
- Specified by:
getRoots
in interfaceBigraph<DefaultDynamicSignature>
-
getSites
- Specified by:
getSites
in interfaceBigraph<DefaultDynamicSignature>
-
getOuterNames
- Specified by:
getOuterNames
in interfaceBigraph<DefaultDynamicSignature>
-
getInnerNames
- Specified by:
getInnerNames
in interfaceBigraph<DefaultDynamicSignature>
-
getAllPlaces
Description copied from interface:Bigraph
Returns all places of the bigraph, i.e., roots, nodes and sites.- Specified by:
getAllPlaces
in interfaceBigraph<DefaultDynamicSignature>
- Returns:
- all places of the bigraph
-
getAllLinks
- Specified by:
getAllLinks
in interfaceBigraph<DefaultDynamicSignature>
-
getEdges
- Specified by:
getEdges
in interfaceBigraph<DefaultDynamicSignature>
-
getParent
Description copied from interface:Bigraph
Get the parent of a bigraph's place. Passing a root as argument will always returnnull
.- Specified by:
getParent
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- a place of this bigraph- Returns:
- the parent of the given place, or
null
-
getSiblingsOfInnerName
Description copied from interface:Bigraph
Returns all siblings of an inner name. The collection will not contain any port.- Specified by:
getSiblingsOfInnerName
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
innerName
- the inner name who's siblings should be returned- Returns:
- the siblings connected to
innerName
-
getSiblingsOfNode
Description copied from interface:Bigraph
Returns all siblings of the given node of the current bigraph. The node itself is not included.- Specified by:
getSiblingsOfNode
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the node whoms sibling should be returned- Returns:
- siblings of
node
-
getNodeOfPort
- Specified by:
getNodeOfPort
in interfaceBigraph<DefaultDynamicSignature>
-
getPorts
Return 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.The list is ordered subject to the ports indices.
- Specified by:
getPorts
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the node who's ports shall be returned- Returns:
- all ports of a node
-
getPortCount
Description copied from interface:Bigraph
Get the number of "blocked/occupied" ports by links of a node. Check with the control's arity.- Specified by:
getPortCount
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the node- Returns:
- the port count of the node which are already used by links
-
getPointsFromLink
Description copied from interface:Bigraph
Get all point entities (i.e., ports and inner names) of a link entity (i.e., edges and outer names).- Specified by:
getPointsFromLink
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
linkEntity
- the link entity who's connections shall be returned- Returns:
- collection of points connected to the link entity
-
getLinkOfPoint
Description copied from interface:Bigraph
Returns the link of a bigraph's point type.- Specified by:
getLinkOfPoint
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
point
- a point of the bigraph- Returns:
- returns the link that connects the point a
null
-
getChildrenOf
Description copied from interface:Bigraph
Returns the set of children of a given node (including sites).
If the node has no children, then an empty set is returned.- Specified by:
getChildrenOf
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the node whose children should be returned- Returns:
- a set of children of the given node
-
getNodes
- Specified by:
getNodes
in interfaceBigraph<DefaultDynamicSignature>
-
getTopLevelRoot
- Specified by:
getTopLevelRoot
in interfaceBigraph<DefaultDynamicSignature>
-
isParentOf
Description copied from interface:Bigraph
A recursive function that checks, whether the given node haspossibleParent
as parent. This means thatpossibleParent
must not necessarily be the direct parent, but can also be a parent higher in the hierarchy.- Specified by:
isParentOf
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
node
- the node to check against the parentpossibleParent
possibleParent
- the possible parent to check againstnode
- Returns:
true
, ifpossibleParent
is directly or indirectly the parent ofnode
, otherwisefalse
-
areConnected
public <C extends Control<?,?>> boolean areConnected(BigraphEntity.NodeEntity<C> place1, BigraphEntity.NodeEntity<C> place2) Description copied from interface:Bigraph
Check if two nodes are connected to each other. The method considers connections by edges and outer names.- Specified by:
areConnected
in interfaceBigraph<DefaultDynamicSignature>
- Parameters:
place1
- left nodeplace2
- right node- Returns:
- true, if the two nodes are connected by an edge or outer name
-