Class AbstractDynamicMatchAdapter<S extends AbstractEcoreSignature<? extends Control<?,?>>,B extends Bigraph<S> & EcoreBigraph<S>>
java.lang.Object
org.bigraphs.framework.core.BigraphDelegator<S>
org.bigraphs.framework.simulation.matching.AbstractDynamicMatchAdapter<S,B>
- All Implemented Interfaces:
Bigraph<S>
,EcoreBigraph<S>
,EcoreBigraphExt
,HasSignature<S>
- Direct Known Subclasses:
PureBigraphAgentAdapter
,PureBigraphRedexAdapter
public abstract class AbstractDynamicMatchAdapter<S extends AbstractEcoreSignature<? extends Control<?,?>>,B extends Bigraph<S> & EcoreBigraph<S>>
extends BigraphDelegator<S>
implements EcoreBigraph<S>
An adapter for bigraphs used for the matching procedure.
Encapsulates a bigraph with a dynamic signature and provides different accessor methods for the underlying bigraph which are used/needed for the matching algorithm
- Author:
- Dominik Grzelak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Data structure to represent a pairNested classes/interfaces inherited from interface org.bigraphs.framework.core.EcoreBigraph
EcoreBigraph.Stub<S extends AbstractEcoreSignature<?>>
-
Field Summary
FieldsFields inherited from class org.bigraphs.framework.core.BigraphDelegator
bigraphDelegate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPlaceToList
(List<BigraphEntity<?>> list, org.eclipse.emf.ecore.EObject each, boolean withSites) Convenient method that finds the corresponding 'node type' (e.g., root) of a givenEObject
instance and adds it to the given listlist
.void
int
degreeOf
(BigraphEntity<?> nodeEntity) Get the number of all in- and out-going edges of a node within the place graph.org.eclipse.collections.api.list.ImmutableList<BigraphEntity<?>>
Internal vertices have childrenStream<BigraphEntity<?>>
List<BigraphEntity<?>>
Get all leaves of a the bigraph's place graph (i.e., a tree).org.eclipse.collections.api.list.ImmutableList<BigraphEntity<?>>
Get all vertices (roots and nodes) without sites.List<BigraphEntity<?>>
getAllVerticesBfsOrderFrom
(BigraphEntity<?> eachRoot) Stream<BigraphEntity<?>>
List<BigraphEntity<?>>
getChildren
(BigraphEntity<?> node) Get all children of a bigraph node precluding all sites.org.eclipse.emf.ecore.EObject
Return the Ecore-based instance model of a bigraph object or signature object.getLinksOfNode
(BigraphEntity<?> node) Note: Only the port indices are important for the order, not the name itself.org.eclipse.emf.ecore.EPackage
Return the metamodel of a bigraph object or a signature object.List<BigraphEntity<?>>
getNodesOfLink
(BigraphEntity.Link outerName) org.eclipse.collections.api.list.MutableList<BigraphEntity<?>>
getOpenNeighborhoodOfVertex
(BigraphEntity<?> node) This method is used solely for the matching algorithm.getRoots()
List<BigraphEntity<?>>
getSubtreeOfNode
(BigraphEntity<?> node) protected List<BigraphEntity<?>>
neighborhoodHook
(List<BigraphEntity<?>> neighbors, BigraphEntity<?> node) Methods inherited from class org.bigraphs.framework.core.BigraphDelegator
areConnected, getAllLinks, getAllPlaces, getChildrenOf, getEdges, getInnerNames, getLevelOf, getLinkOfPoint, getNodeOfPort, getNodes, getOuterNames, getParent, getPointsFromLink, getPortCount, getPorts, getSiblingsOfInnerName, getSiblingsOfNode, getSignature, getSites, getTopLevelRoot, isParentOf
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, getSignature, isBEdge, isBInnerName, isBLink, isBNode, isBOuterName, isBPlace, isBPoint, isBPort, isBRoot, isBSite, isIndexable, isNameable, isOfEClass
-
Field Details
-
throwableSupplier
-
-
Constructor Details
-
AbstractDynamicMatchAdapter
-
-
Method Details
-
getBigraphDelegate
- Overrides:
getBigraphDelegate
in classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
getRoots
- Specified by:
getRoots
in interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Overrides:
getRoots
in classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
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
-
clearCache
public void clearCache() -
getLinksOfNode
public abstract AbstractSequentialList<AbstractDynamicMatchAdapter.ControlLinkPair> getLinksOfNode(BigraphEntity<?> node) Note: Only the port indices are important for the order, not the name itself.- Parameters:
node
- the node- Returns:
- a list of all links connected to the given node
-
getSubtreeOfNode
-
getNodesOfLink
-
degreeOf
Get the number of all in- and out-going edges of a node within the place graph.
Sites are included in the count.- Parameters:
nodeEntity
- the node- Returns:
- degree of the node
-
neighborhoodHook
protected List<BigraphEntity<?>> neighborhoodHook(List<BigraphEntity<?>> neighbors, BigraphEntity<?> node) -
addPlaceToList
protected void addPlaceToList(List<BigraphEntity<?>> list, org.eclipse.emf.ecore.EObject each, boolean withSites) Convenient method that finds the corresponding 'node type' (e.g., root) of a givenEObject
instance and adds it to the given listlist
.Throws a runtime exception of the node couldn't be found.
- Parameters:
list
- the listeach
- node entity (e.g., root, node or site)withSites
- flag to consider sites or not
-
getOpenNeighborhoodOfVertex
public org.eclipse.collections.api.list.MutableList<BigraphEntity<?>> getOpenNeighborhoodOfVertex(BigraphEntity<?> node) This method is used solely for the matching algorithm. Sites are excluded in the list. Doesn't include the node itself. Opposite is the closed neighborhood which includes the node itself.- Specified by:
getOpenNeighborhoodOfVertex
in interfaceBigraph<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Overrides:
getOpenNeighborhoodOfVertex
in classBigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Parameters:
node
- the node- Returns:
-
getAllVertices
Get all vertices (roots and nodes) without sites.- Returns:
- all vertices of the bigraph without sites
-
getAllInternalVerticesPostOrder
public org.eclipse.collections.api.list.ImmutableList<BigraphEntity<?>> getAllInternalVerticesPostOrder()Internal vertices have children- Returns:
-
getAllInternalVerticesPostOrderAsStream
-
getAllVerticesPostOrder
-
getAllVerticesBfsOrder
-
getAllVerticesBfsOrderStream
-
getAllVerticesBfsOrderFrom
-
getChildren
Get all children of a bigraph node precluding all sites. This method is used solely for the matching algorithm.- Parameters:
node
- the node- Returns:
- all children of the given node
-
getAllLeaves
Get all leaves of a the bigraph's place graph (i.e., a tree). This method is used solely for the matching algorithm.- Returns:
- all leaves of the place graph
-