Class PureBigraphBuilder<S extends AbstractEcoreSignature<? extends Control<?,?>>>
- All Implemented Interfaces:
BigraphBuilder<S>
- Direct Known Subclasses:
KindBigraphBuilder,MutableBuilder
BigraphBuilder implementation for pure bigraphs.
Typical usage begins with root() and proceeds by creating
children, hierarchies, and sites.
For compositions, see PureBigraphComposite, accessible with BigraphFactory.ops(Bigraph).
- Author:
- Dominik Grzelak
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA bigraph consists of many node hierarchy.Nested classes/interfaces inherited from class org.bigraphs.framework.core.BigraphBuilderSupport
BigraphBuilderSupport.InstanceParameterNested classes/interfaces inherited from interface org.bigraphs.framework.core.BigraphBuilder
BigraphBuilder.NodeHierarchy<S extends Signature<? extends Control<?,?>>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, BigraphEntity.Edge> protected final Map<String, BigraphEntity.InnerName> protected final Map<String, BigraphEntity.NodeEntity> protected final Map<String, BigraphEntity.OuterName> protected final Map<Integer, BigraphEntity.RootEntity> protected final Map<Integer, BigraphEntity.SiteEntity> protected org.eclipse.emf.ecore.EObjectprotected org.eclipse.emf.ecore.EPackageFields inherited from class org.bigraphs.framework.core.BigraphBuilderSupport
DEFAULT_EDGE_PREFIX, DEFAULT_VERTEX_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel) protectedPureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath) protectedPureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath, String instanceModelFilePath) protectedPureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel, EMetaModelData metaModelData) protectedPureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) protectedPureBigraphBuilder(S signature) protectedPureBigraphBuilder(S signature, String metaModelFilePath) protectedPureBigraphBuilder(S signature, String metaModelFilePath, String instanceModelFilePath) protectedPureBigraphBuilder(S signature, EMetaModelData metaModelData) protectedPureBigraphBuilder(S signature, org.eclipse.emf.ecore.EPackage metaModel, String instanceModelFilePath) protectedPureBigraphBuilder(S signature, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInnerTo(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) Connects the inner nametoAttachtoinnerNamevia alink (i.e., an edge or outer name).voidChecks whether a node's ports can be connected to a link (i.e., an edge or an outer name which in turn also includes inner names).protected voidClears all generated intermediate results of the bigraph's current construction inside the builder.Closes all inner names and doesn't keep idle edges and idle inner names.voidcloseInner(String innerName, boolean keepIdleName) Convenient method forcloseInner(BigraphEntity.InnerName, boolean)voidcloseInner(BigraphEntity.InnerName innerName) Convenient method forcloseInner(BigraphEntity.InnerName, boolean).voidcloseInner(BigraphEntity.InnerName... innerName) voidcloseInner(BigraphEntity.InnerName innerName, boolean keepIdleName) Closes all outer names.voidcloseOuter(String outerName, boolean keepIdleName) Convenient method forcloseOuter(BigraphEntity.OuterName, boolean)voidcloseOuter(BigraphEntity.OuterName outerName) Closes the outer name by removing all connections and the outer name itself.voidcloseOuter(BigraphEntity.OuterName outerName, boolean keepIdleName) If an inner name is connected to an outer name, the inner name will remain (i.e., not be removed).protected BigraphEntity.EdgeconnectByEdge(BigraphEntity.NodeEntity<Control>... nodes) protected voidconnectInnerToLink(BigraphEntity.InnerName innerName, BigraphEntity.Link edge) protected voidconnectNodeToOuterName(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.OuterName outerName) Helper method to connect a node to an outer name.protected voidconnectToEdge(BigraphEntity.NodeEntity<Control> node, BigraphEntity.Edge edge) no checks are done here... useisConnectedWithLink(BigraphEntity.NodeEntity, EObject)protected voidconnectToLinkUsingIndex(BigraphEntity.NodeEntity<Control> node, BigraphEntity theLink, int customPortIndex) create()static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull S signature) Should not be directly called by the user.static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> Should not be directly called by the user.static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull S signature, EMetaModelData metaModelData) Should not be directly called by the user.static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull S signature, @NonNull org.eclipse.emf.ecore.EPackage bigraphMetaModel, String instanceModelFilePath) static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull S signature, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance) static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, String metaModelFilePath, String instanceModelFilePath) static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, EMetaModelData metaModelData) static <S extends AbstractEcoreSignature<? extends Control<?,?>>>
PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) protected BigraphEntity.EdgeCreates an edge of EClassBEdgeand adds it to the list of available edgesavailableEdges.protected BigraphEntity.EdgecreateEdgeOfEClass(org.eclipse.emf.ecore.EObject eObject) protected org.eclipse.emf.ecore.EObjectcreateEdgeOfEClass0(String edgeName) createInner(String name) Returns the same inner name if it already exists under the samenameprotected org.eclipse.emf.ecore.EObjectprotected org.eclipse.emf.ecore.EObjectcreateNodeOfEClass(String name, @NonNull Control control) protected org.eclipse.emf.ecore.EObjectcreateNodeOfEClass(String name, @NonNull Control control, String nodeIdentifier) createOuter(String name) This method returns the same outer name if it already exists under the samename, otherwise it will be created and returned.protected org.eclipse.emf.ecore.EObjectprotected org.eclipse.emf.ecore.EObjectcreatePortWithIndex(int index) Helper method that creates a bigraphical portEObjectwith the given index.protected org.eclipse.emf.ecore.EObjectcreateRootOfEClass(int index) protected org.eclipse.emf.ecore.EObjectcreateSiteOfEClass(int index) protected org.eclipse.emf.ecore.EObjectorg.eclipse.emf.ecore.EPackageCreates a new independent hierarchy which can be added later.protected booleanisConnectedWithLink(BigraphEntity.NodeEntity<Control> place, @Nullable org.eclipse.emf.ecore.EObject theLink) Helper method to check if a given node is connected to the given link.linkInner(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2) Convenient method oflinkInner(BigraphEntity.InnerName, BigraphEntity.InnerName, boolean)which doesn't keep idle edges when inner names are already connected to a node.linkInner(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2, boolean keepIdleEdges) Connects two existing inner names by an edge.linkInnerToOuter(BigraphEntity innerName, BigraphEntity outerName) Connects an inner name to an outer name.protected voidlinkInnerToOuter0(BigraphEntity innerName, BigraphEntity outerName) Ecore specific - only called by methods of this builder internallyvoidlinkNodeToInner(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName innerName) Link a node with an inner name by an edgevoidlinkNodeToInner(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName... innerNames) Link multiple inner names by an edge to one nodeprotected voidloadSignatureMetaModel(String metaModelFilePath) Does not re-create control nodes of typeEClassbecause it directly uses the bigraphical Ecore metamodel.voidConverts the current bigraph to a ground bigraph (i.e., no sites an no inner names).root()Create a root node under which additional nodes or hierarchies can be place.spawn()Spawns a fresh bigraph builder but with exactly the same instance of the extended bigraph metamodel and signature as before.Methods inherited from class org.bigraphs.framework.core.BigraphBuilderSupport
assertSortingIsEnsuredForControl, assertSortingIsEnsuredForControl, createBBigraphContainer, createIndexSupplier, createNameSupplier, executeValidationChain, getSignatureFromMetaModel, isEdge, isNode, isOuter, isRoot
-
Field Details
-
metaModel
protected org.eclipse.emf.ecore.EPackage metaModel -
loadedInstanceModel
protected org.eclipse.emf.ecore.EObject loadedInstanceModel -
availableEdges
-
availableOuterNames
-
availableInnerNames
-
availableRoots
-
availableSites
-
availableNodes
-
-
Constructor Details
-
PureBigraphBuilder
-
PureBigraphBuilder
protected PureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel) - Throws:
SignatureValidationFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(S signature, EMetaModelData metaModelData) throws BigraphMetaModelLoadingFailedException - Throws:
BigraphMetaModelLoadingFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel, EMetaModelData metaModelData) - Throws:
SignatureValidationFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(S signature, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) -
PureBigraphBuilder
protected PureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureMetaModel, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) - Throws:
SignatureValidationFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(S signature, String metaModelFilePath, String instanceModelFilePath) throws BigraphMetaModelLoadingFailedException - Throws:
BigraphMetaModelLoadingFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(S signature, org.eclipse.emf.ecore.EPackage metaModel, String instanceModelFilePath) throws BigraphMetaModelLoadingFailedException -
PureBigraphBuilder
protected PureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath, String instanceModelFilePath) - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(S signature, String metaModelFilePath) throws BigraphMetaModelLoadingFailedException - Throws:
BigraphMetaModelLoadingFailedException- If the provided signature instance model does not conform the the builders signature typeS
-
PureBigraphBuilder
protected PureBigraphBuilder(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath) - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeS
-
-
Method Details
-
spawn
Description copied from interface:BigraphBuilderSpawns a fresh bigraph builder but with exactly the same instance of the extended bigraph metamodel and signature as before.- Returns:
- a fresn bigraph builder with the same bigraph metamodel and signature metamodel
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature, String metaModelFilePath, String instanceModelFilePath) throws BigraphMetaModelLoadingFailedException Should not be directly called by the user. Instead use theAbstractBigraphFactory.- Type Parameters:
S- the type of the signature- Parameters:
signature- the signature for the builder and the generated bigraphmetaModelFilePath- the file to the Ecore meta modelinstanceModelFilePath- file path to the instance model- Returns:
- a configured builder with the bigraph instance loaded
- Throws:
BigraphMetaModelLoadingFailedException- If the provided signature metamodel does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, String metaModelFilePath, String instanceModelFilePath) - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature, @NonNull org.eclipse.emf.ecore.EPackage bigraphMetaModel, String instanceModelFilePath) -
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) throws BigraphMetaModelLoadingFailedException - Throws:
BigraphMetaModelLoadingFailedException- If the provided bigraph metamodel could not be loaded
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature) throws BigraphMetaModelLoadingFailedException Should not be directly called by the user. Instead use theAbstractBigraphFactory.- Type Parameters:
S- type of the signature- Parameters:
signature- the signature for the builder- Returns:
- a pure bigraph builder with the given signature
- Throws:
BigraphMetaModelLoadingFailedException- If the provided bigraph metamodel does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance) throws BigraphMetaModelLoadingFailedException - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeSBigraphMetaModelLoadingFailedException
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature, EMetaModelData metaModelData) throws BigraphMetaModelLoadingFailedException Should not be directly called by the user. Instead use theAbstractBigraphFactory.- Type Parameters:
S- the type of the signature- Parameters:
signature- the signature for the builder and generated bigraphmetaModelData- the meta data to use for the model- Returns:
- a pure bigraph builder over the given signature
- Throws:
BigraphMetaModelLoadingFailedException- If the provided bigraph metamodel does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, EMetaModelData metaModelData) throws BigraphMetaModelLoadingFailedException - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeSBigraphMetaModelLoadingFailedException
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull S signature, String metaModelFileName) throws BigraphMetaModelLoadingFailedException - Throws:
BigraphMetaModelLoadingFailedException- If the provided bigraph metamodel does not conform the the builders signature typeS
-
create
public static <S extends AbstractEcoreSignature<? extends Control<?,?>>> PureBigraphBuilder<S> create(@NonNull org.eclipse.emf.ecore.EObject signatureInstance, String metaModelFileName) throws BigraphMetaModelLoadingFailedException - Throws:
SignatureValidationFailedException- If the provided signature instance model does not conform the the builders signature typeSBigraphMetaModelLoadingFailedException
-
getMetaModel
public org.eclipse.emf.ecore.EPackage getMetaModel()- Specified by:
getMetaModelin classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getInstanceModel
protected org.eclipse.emf.ecore.EObject getInstanceModel()- Specified by:
getInstanceModelin classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getAvailableEClasses
- Specified by:
getAvailableEClassesin classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
getAvailableEReferences
- Specified by:
getAvailableEReferencesin classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,?>>>
-
root
Description copied from interface:BigraphBuilderCreate a root node under which additional nodes or hierarchies can be place.A hierarchy is returned which contains a collection of nodes in a tree structure. The hierarchy
BigraphBuilder.NodeHierarchyprovides additional methods for adding nodes and sites. The hierarchy can only be used with theBigraphBuilderwhich created it.- Returns:
- a hierarchical tree structure
-
hierarchy
Creates a new independent hierarchy which can be added later.- Parameters:
control- the control of the parent for the new hierarchy- Returns:
- a new hierarchy for the current bigraph
-
hierarchy
-
createSiteOfEClass
protected org.eclipse.emf.ecore.EObject createSiteOfEClass(int index) -
createRootOfEClass
protected org.eclipse.emf.ecore.EObject createRootOfEClass(int index) -
createInnerNameOfEClass
-
createOuterNameOfEClass
-
createOuter
This method returns the same outer name if it already exists under the samename, otherwise it will be created and returned.- Parameters:
name- the name for the outer name- Returns:
- a new outer name or an existing one with the same name
-
createInner
Returns the same inner name if it already exists under the samename- Parameters:
name- the name for the inner name- Returns:
- a new inner name or an existing one with the same name
-
connectToEdge
no checks are done here... useisConnectedWithLink(BigraphEntity.NodeEntity, EObject)- Parameters:
node- the node to connectedge- the edge to use to connect the node- See Also:
-
connectInnerToLink
-
connectToLinkUsingIndex
protected void connectToLinkUsingIndex(BigraphEntity.NodeEntity<Control> node, BigraphEntity theLink, int customPortIndex) -
connectByEdge
protected BigraphEntity.Edge connectByEdge(BigraphEntity.NodeEntity<Control>... nodes) throws InvalidArityOfControlException - Throws:
InvalidArityOfControlException
-
linkInnerToOuter
public PureBigraphBuilder<S> linkInnerToOuter(BigraphEntity innerName, BigraphEntity outerName) throws InvalidConnectionException Connects an inner name to an outer name. The inner and outer name must be created with the same builder. If they are already connected or doesn't belong to the builder than this builder is simply returned without an error.- Parameters:
innerName- the inner name to be connected to the outer nameouterName- the outer name- Returns:
- this builder instance
- Throws:
InvalidConnectionException- link couldn't be established because of already existing connection of the provided links
-
linkInnerToOuter0
Ecore specific - only called by methods of this builder internally- Parameters:
innerName- the inner nameouterName- the outer name
-
linkNodeToInner
public void linkNodeToInner(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName innerName) throws LinkTypeNotExistsException, InvalidConnectionException Link a node with an inner name by an edge- Parameters:
node1- the nodeinnerName- the inner name- Throws:
LinkTypeNotExistsException- if the inner name doesn't exists (i.e., doesn't belong from this builderInvalidArityOfControlException- if the control cannot connect anything (e.g., is atomic, or no open ports left)InvalidConnectionException- if the inner name is already connected to an outer name
-
linkNodeToInner
public void linkNodeToInner(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName... innerNames) throws LinkTypeNotExistsException, InvalidConnectionException Link multiple inner names by an edge to one nodeOld links of inner names (i.e., edges and outer names) are replaced by the freshly created edge.
- Parameters:
node1- the nodeinnerNames- the inner name- Throws:
LinkTypeNotExistsException- if the inner name doesn't exists (i.e., doesn't belong from this builderInvalidArityOfControlException- if the control cannot connect anything (e.g., is atomic, or no open ports left)InvalidConnectionException- if the inner name is already connected to an outer name
-
addInnerTo
public void addInnerTo(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) throws LinkTypeNotExistsException, InvalidConnectionException Connects the inner nametoAttachtoinnerNamevia alink (i.e., an edge or outer name). IfinnerNameis already connected to alink , thislink will be used for attachingtoAttach. If no link is present forinnerName, a new edge will be created.- Parameters:
innerName- the inner name that will be linked withtoAttachvia a new link, or an existing onetoAttach- the inner name that shall be linked withinnerNamevia a new link, or an existing one frominnerName- Throws:
LinkTypeNotExistsExceptionInvalidConnectionException
-
linkInner
public PureBigraphBuilder<S> linkInner(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2) throws InvalidConnectionException Convenient method oflinkInner(BigraphEntity.InnerName, BigraphEntity.InnerName, boolean)which doesn't keep idle edges when inner names are already connected to a node. Meaning, that the last argument defaults tofalse.- Parameters:
ecoreInnerName1- an existing inner nameecoreInnerName2- an existing inner name- Returns:
- the builder
- Throws:
InvalidConnectionException- if the inner names could not be connected.
-
linkInner
public PureBigraphBuilder<S> linkInner(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2, boolean keepIdleEdges) throws InvalidConnectionException Connects two existing inner names by an edge.If they are already connected the class itself is returned.
The method will throw an exception if one of the given inner names are already connected to an outer name.
If they are already connected to another edge from a node than the parameter
keepIdleEdgesdecides whether to keep the idle edges of the nodes when connecting the inner names or to remove them completely.- Parameters:
ecoreInnerName1- an existing inner nameecoreInnerName2- an existing inner namekeepIdleEdges- flag to decide whether idle edges should remain- Returns:
- the builder class
- Throws:
InvalidConnectionException- if the inner name could not be connected
-
checkIfNodeIsConnectable
public void checkIfNodeIsConnectable(BigraphEntity.NodeEntity<Control> node) throws InvalidArityOfControlException Checks whether a node's ports can be connected to a link (i.e., an edge or an outer name which in turn also includes inner names).The verification is based on the arity of the control and current connections made so far.
- Parameters:
node- the node to check- Throws:
InvalidArityOfControlException- if control is atomic or the current connections exceed the control's arity
-
connectNodeToOuterName
protected void connectNodeToOuterName(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.OuterName outerName) throws TypeNotExistsException, InvalidArityOfControlException Helper method to connect a node to an outer name.- Parameters:
node1- the node to connectouterName- the outer name to which the node is connected- Throws:
LinkTypeNotExistsException- if the link is contained in the bigraphInvalidArityOfControlException- if the node cannot connect links anymoreTypeNotExistsException
-
createPortWithIndex
protected org.eclipse.emf.ecore.EObject createPortWithIndex(int index) Helper method that creates a bigraphical portEObjectwith the given index.- Parameters:
index- the index for the newly created port instance.- Returns:
- a new port instance with the index set
-
isConnectedWithLink
protected boolean isConnectedWithLink(BigraphEntity.NodeEntity<Control> place, @Nullable org.eclipse.emf.ecore.EObject theLink) Helper method to check if a given node is connected to the given link. If the link isnull, thenfalseis returned.- Parameters:
place- the node to testtheLink- the link- Returns:
true, if the given place is connected with the link, otherwisefalse.
-
createNodeOfEClass
-
createNodeOfEClass
-
createEdgeOfEClass0
-
createEdgeOfEClass
Creates an edge of EClassBEdgeand adds it to the list of available edgesavailableEdges.- Returns:
- the freshly created edge
-
createEdgeOfEClass
-
create
-
makeGround
public void makeGround()Converts the current bigraph to a ground bigraph (i.e., no sites an no inner names). -
closeInner
Closes all inner names and doesn't keep idle edges and idle inner names. -
closeInner
- Throws:
LinkTypeNotExistsException
-
closeInner
Convenient method forcloseInner(BigraphEntity.InnerName, boolean)- Throws:
TypeNotExistsException
-
closeInner
Convenient method forcloseInner(BigraphEntity.InnerName, boolean). The last argument defaults tofalse.- Parameters:
innerName- an inner name- Throws:
TypeNotExistsException- if the given inner names is not contained in the bigraph.
-
closeInner
public void closeInner(BigraphEntity.InnerName innerName, boolean keepIdleName) throws LinkTypeNotExistsException - Specified by:
closeInnerin classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,?>>> - Throws:
LinkTypeNotExistsException
-
closeOuter
Closes all outer names. SeecloseOuter(BigraphEntity.OuterName). -
closeOuter
Closes the outer name by removing all connections and the outer name itself. This method doesn't allow idle names. Connected nodes over the same name will not be connected by an edge.- Parameters:
outerName- the outer name to remove- Throws:
TypeNotExistsException- if the passed outer name is not contained in the bigraph
-
closeOuter
Convenient method forcloseOuter(BigraphEntity.OuterName, boolean)- Throws:
TypeNotExistsException
-
closeOuter
public void closeOuter(BigraphEntity.OuterName outerName, boolean keepIdleName) throws TypeNotExistsException If an inner name is connected to an outer name, the inner name will remain (i.e., not be removed). The port of a connected node is removed.- Parameters:
outerName- the outer name to removekeepIdleName-true, if the outer name shall be kept as an idle name; andfalseto remove- Throws:
TypeNotExistsException- if the passed outer name is not contained in the bigraph
-
loadSignatureMetaModel
Does not re-create control nodes of typeEClassbecause it directly uses the bigraphical Ecore metamodel. May throw a runtime exception.- Parameters:
metaModelFilePath- the filepath to the bigraphical metamodel containing signature information.- Throws:
BigraphMetaModelLoadingFailedException- if metamodel could not be loaded
-
clearIntermediateResults
protected void clearIntermediateResults()Clears all generated intermediate results of the bigraph's current construction inside the builder.
Should not be called. Is made available for theMutableBuilder.
-