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
  • Field Details

  • Constructor Details

    • AbstractDynamicMatchAdapter

      public AbstractDynamicMatchAdapter(B bigraph)
  • Method Details

    • getBigraphDelegate

      public B getBigraphDelegate()
      Overrides:
      getBigraphDelegate in class BigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
    • getRoots

      public List<BigraphEntity.RootEntity> getRoots()
      Specified by:
      getRoots in interface Bigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>>
      Overrides:
      getRoots in class BigraphDelegator<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 interface EcoreBigraphExt
      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 interface EcoreBigraphExt
      Returns:
      the instance model in Ecore format
    • clearCache

      public void clearCache()
    • getLinksOfNode

      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

      public List<BigraphEntity<?>> getSubtreeOfNode(BigraphEntity<?> node)
    • getNodesOfLink

      public List<BigraphEntity<?>> getNodesOfLink(BigraphEntity.Link outerName)
    • degreeOf

      public int degreeOf(BigraphEntity<?> nodeEntity)
      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 given EObject instance and adds it to the given list list.

      Throws a runtime exception of the node couldn't be found.

      Parameters:
      list - the list
      each - 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 interface Bigraph<S extends AbstractEcoreSignature<? extends Control<?,?>>>
      Overrides:
      getOpenNeighborhoodOfVertex in class BigraphDelegator<S extends AbstractEcoreSignature<? extends Control<?,?>>>
      Parameters:
      node - the node
      Returns:
    • getAllVertices

      public org.eclipse.collections.api.list.ImmutableList<BigraphEntity<?>> 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

      public Stream<BigraphEntity<?>> getAllInternalVerticesPostOrderAsStream()
    • getAllVerticesPostOrder

      public Iterable<BigraphEntity<?>> getAllVerticesPostOrder()
    • getAllVerticesBfsOrder

      public Iterable<BigraphEntity<?>> getAllVerticesBfsOrder()
    • getAllVerticesBfsOrderStream

      public Stream<BigraphEntity<?>> getAllVerticesBfsOrderStream()
    • getAllVerticesBfsOrderFrom

      public List<BigraphEntity<?>> getAllVerticesBfsOrderFrom(BigraphEntity<?> eachRoot)
    • getChildren

      public List<BigraphEntity<?>> getChildren(BigraphEntity<?> node)
      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

      public List<BigraphEntity<?>> 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