Package org.bigraphs.framework.core
Interface Bigraph<S extends Signature<?>>
- Type Parameters:
S
- type of the signature
- All Superinterfaces:
HasSignature<S>
- All Known Implementing Classes:
AbstractDynamicMatchAdapter
,BigraphCompositeSupport
,BigraphDelegator
,DiscreteIon
,ElementaryBigraph
,KindBigraph
,Linkings.Closure
,Linkings.Identity
,Linkings.IdentityEmpty
,Linkings.Substitution
,Placings.Barren
,Placings.Identity1
,Placings.Join
,Placings.Merge
,Placings.Permutation
,Placings.Symmetry
,PureBigraph
,PureBigraphAgentAdapter
,PureBigraphComposite
,PureBigraphRedexAdapter
Generic bigraph interface of all bigraph entities in this framework.
This interface is primarily implemented by pure bigraphs.
Important direct implementations are:
- Author:
- Dominik Grzelak
-
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()
default <C extends Control<?,
?>>
Collection<BigraphEntity.Link>Returns all incidents links (i.e., edges and outer names) for the given nodedefault Map.Entry<Set<FiniteOrdinal<Integer>>,
Set<StringTypedName>> 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.<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.default Map.Entry<Set<FiniteOrdinal<Integer>>,
Set<StringTypedName>> 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()
default Collection<BigraphEntity<?>>
Returns the support of a bigraph.getTopLevelRoot
(BigraphEntity<?> node) default boolean
isActive()
A bigraph is active if all its sites are active.default <C extends Control<?,
?>>
booleanisActiveAtNode
(BigraphEntity.NodeEntity<C> node) default boolean
isActiveAtSite
(int siteIndex) A site is active if all its ancestors are also active.default boolean
A discrete bigraph has no edges and its link map is bijective (all names are distinct and every point is open).default boolean
A concrete bigraph is epi (epimorphic) iff its place graph has no idle root (i.e., no root is a barren) and its link graph has no idle outer names.default boolean
isGround()
Checks, if the bigraph is ground, that is, whether the inner interface is empty (no sites and no inner names).default boolean
Checks if the bigraph is guarding.default boolean
isLean()
A bigrap is lean if it contains no idle edges.default boolean
A concrete bigraph is mono (monomorphic) iff no two sites are siblings ("inner-injective") and no two inner names are siblings.boolean
isParentOf
(BigraphEntity<?> node, BigraphEntity<?> possibleParent) A recursive function that checks, whether the given node haspossibleParent
as parent.default boolean
isPrime()
Checks, if the bigraph is prime.
-
Method Details
-
getSignature
S getSignature()Description copied from interface:HasSignature
Get the corresponding signature of the underlying bigraph- Specified by:
getSignature
in interfaceHasSignature<S extends Signature<?>>
- Returns:
- the signature of the bigraph
-
isGround
default boolean isGround()Checks, if the bigraph is ground, that is, whether the inner interface is empty (no sites and no inner names).- Returns:
true
, if the bigraph is ground, otherwisefalse
-
isPrime
default boolean isPrime()Checks, if the bigraph is prime. A Prime bigraph has only one root and no inner names.- Returns:
true
, if the bigraph is prime, otherwisefalse
.
-
isEpimorphic
default boolean isEpimorphic()A concrete bigraph is epi (epimorphic) iff its place graph has no idle root (i.e., no root is a barren) and its link graph has no idle outer names.- Returns:
true
if the bigraph is epi, otherwisefalse
-
isMonomorphic
default boolean isMonomorphic()A concrete bigraph is mono (monomorphic) iff no two sites are siblings ("inner-injective") and no two inner names are siblings. With other words, every edge has at most one inner name (= no two inner names are peers).- Returns:
true
if the bigraph is mono, otherwisefalse
-
isLean
default boolean isLean()A bigrap is lean if it contains no idle edges.- Returns:
true
, if the bigraph is lean, otherwisefalse
.
-
getSupport
Returns the support of a bigraph. The support is a finite set comprising the nodes of the place graph and the edges of the link graph of the current bigraph.Only concrete bigraphs have a support. If this set is empty, the bigraph is considered as abstract.
- Returns:
- the support |B| of the bigraph B
-
isActiveAtSite
default boolean isActiveAtSite(int siteIndex) A site is active if all its ancestors are also active.- Parameters:
siteIndex
- the index of the site to check- Returns:
true
if the site is active, otherwisefalse
-
isActiveAtNode
-
isActive
default boolean isActive()A bigraph is active if all its sites are active. SeeisActiveAtSite(int)
.- Returns:
true
if the bigraph is active.
-
isGuarding
default boolean isGuarding()Checks if the bigraph is guarding. A bigraph is guarding if no site has a root as parent and no inner name is open.- Returns:
true
if the bigraph is guarding, otherwisefalse
-
isDiscrete
default boolean isDiscrete()A discrete bigraph has no edges and its link map is bijective (all names are distinct and every point is open).See: 1.Jensen, O.H., Milner, R.: Bigraphs and mobile processes (revised). University of Cambridge Computer Laboratory (2004), p. 59.
- Returns:
true
if the bigraph is discrete, otherwisefalse
-
getInnerFace
-
getOuterFace
-
getLevelOf
Get the depth of a place entity in the place graph (i.e., a tree). The depth of a root node is always 0.- Parameters:
place
- the place node in question to compute its depth- Returns:
- the depth of the given place entity of this bigraph
-
getOpenNeighborhoodOfVertex
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).- Parameters:
node
- the nodes who's neighborhood should be returned- Returns:
- the neighborhood of the node of the place graph
-
getRoots
Collection<BigraphEntity.RootEntity> getRoots() -
getSites
Collection<BigraphEntity.SiteEntity> getSites() -
getOuterNames
Collection<BigraphEntity.OuterName> getOuterNames() -
getInnerNames
Collection<BigraphEntity.InnerName> getInnerNames() -
getAllPlaces
Collection<BigraphEntity<?>> getAllPlaces()Returns all places of the bigraph, i.e., roots, nodes and sites.- Returns:
- all places of the bigraph
-
getAllLinks
Collection<BigraphEntity.Link> getAllLinks() -
getEdges
Collection<BigraphEntity.Edge> getEdges() -
getNodes
-
getTopLevelRoot
-
isParentOf
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.- 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
-
getChildrenOf
Returns the set of children of a given node (including sites).
If the node has no children, then an empty set is returned.- Parameters:
node
- the node whose children should be returned- Returns:
- a set of children of the given node
-
getIncidentLinksOf
default <C extends Control<?,?>> Collection<BigraphEntity.Link> getIncidentLinksOf(BigraphEntity.NodeEntity<C> node) Returns all incidents links (i.e., edges and outer names) for the given node- Parameters:
node
- the node- Returns:
- all incident links of
node
-
getParent
Get the parent of a bigraph's place. Passing a root as argument will always returnnull
.- Parameters:
node
- a place of this bigraph- Returns:
- the parent of the given place, or
null
-
getLinkOfPoint
Returns the link of a bigraph's point type.- Parameters:
point
- a point of the bigraph- Returns:
- returns the link that connects the point a
null
-
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.- Parameters:
node
- the node who's ports shall be returned- Returns:
- all ports of a node
-
getPortCount
Get the number of "blocked/occupied" ports by links of a node. Check with the control's arity.- Parameters:
node
- the node- Returns:
- the port count of the node which are already used by links
-
getNodeOfPort
-
getSiblingsOfNode
Returns all siblings of the given node of the current bigraph. The node itself is not included.- Parameters:
node
- the node whoms sibling should be returned- Returns:
- siblings of
node
-
getSiblingsOfInnerName
Returns all siblings of an inner name. The collection will not contain any port.- Parameters:
innerName
- the inner name who's siblings should be returned- Returns:
- the siblings connected to
innerName
-
getPointsFromLink
Get all point entities (i.e., ports and inner names) of a link entity (i.e., edges and outer names).- Parameters:
linkEntity
- the link entity who's connections shall be returned- Returns:
- collection of points connected to the link entity
-
areConnected
<C extends Control<?,?>> boolean areConnected(BigraphEntity.NodeEntity<C> place1, BigraphEntity.NodeEntity<C> place2) Check if two nodes are connected to each other. The method considers connections by edges and outer names.- Parameters:
place1
- left nodeplace2
- right node- Returns:
- true, if the two nodes are connected by an edge or outer name
-