Package org.bigraphs.framework.core
Class BigraphDelegator<S extends Signature<?>>
java.lang.Object
org.bigraphs.framework.core.BigraphDelegator<S>
- Type Parameters:
S- the signature type
- All Implemented Interfaces:
Bigraph<S>,HasSignature<S>
- Direct Known Subclasses:
AbstractDynamicMatchAdapter,BigraphCompositeSupport,ElementaryBigraph
Delegator base class for bigraphs.
Currently supports only pure bigraphs.
Wraps a Bigraph instance and forwards all calls to it.
Subclasses can extend or adapt behavior by overriding selected
methods while reusing the delegate for the core implementation.
- Author:
- Dominik Grzelak
-
Field Summary
Fields -
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.Returns all places of the bigraph, i.e., roots, nodes and sites.getChildrenOf(BigraphEntity<?> node) Returns the set of children of a given node (including sites).getEdges()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.<C extends Control<?,?>>
BigraphEntity.NodeEntity<C> <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.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) booleanisParentOf(BigraphEntity<?> node, BigraphEntity<?> possibleParent) A recursive function that checks, whether the given node haspossibleParentas parent.Methods 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, isPrime
-
Field Details
-
bigraphDelegate
-
-
Constructor Details
-
BigraphDelegator
-
-
Method Details
-
getBigraphDelegate
-
getSignature
Description copied from interface:HasSignatureGet the corresponding signature of the underlying bigraph- Specified by:
getSignaturein interfaceBigraph<S extends Signature<?>>- Specified by:
getSignaturein interfaceHasSignature<S extends Signature<?>>- Returns:
- the signature of the bigraph
-
getRoots
-
getSites
-
getOuterNames
- Specified by:
getOuterNamesin interfaceBigraph<S extends Signature<?>>
-
getInnerNames
- Specified by:
getInnerNamesin interfaceBigraph<S extends Signature<?>>
-
getEdges
-
getNodes
-
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 Signature<?>>- Parameters:
node- the node whose children should be returned- Returns:
- a set of children of the given node
-
areConnected
public <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 Signature<?>>- Parameters:
place1- left nodeplace2- right node- Returns:
- true, if the two nodes are connected by an edge or outer name
-
getParent
Description copied from interface:BigraphGet the parent of a bigraph's place. Passing a root as argument will always returnnull. -
getLinkOfPoint
Description copied from interface:BigraphReturns the link of a bigraph's point type.- Specified by:
getLinkOfPointin interfaceBigraph<S extends Signature<?>>- Parameters:
point- a point of the bigraph- Returns:
- returns the link that connects the point a
null
-
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 Signature<?>>- Parameters:
linkEntity- the link entity who's connections shall be returned- Returns:
- collection of points connected to the link entity
-
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 Signature<?>>- 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 Signature<?>>
-
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 Signature<?>>- 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
-
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 Signature<?>>- Parameters:
innerName- the inner name who's siblings should be returned- Returns:
- the siblings connected to
innerName
-
getNodeOfPort
- Specified by:
getNodeOfPortin interfaceBigraph<S extends Signature<?>>
-
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 Signature<?>>- Parameters:
node- the node whoms sibling should be returned- Returns:
- siblings of
node
-
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 Signature<?>>- Parameters:
place- the place node in question to compute its depth- Returns:
- the depth of the given place entity of this bigraph
-
getAllPlaces
Description copied from interface:BigraphReturns all places of the bigraph, i.e., roots, nodes and sites.- Specified by:
getAllPlacesin interfaceBigraph<S extends Signature<?>>- Returns:
- all places of the bigraph
-
getAllLinks
- Specified by:
getAllLinksin interfaceBigraph<S extends Signature<?>>
-
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. -
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 Signature<?>>- Parameters:
node- the node- Returns:
- the port count of the node which are already used by links
-