Class PureBigraphBuilder<S extends AbstractEcoreSignature<? extends Control<?,?>>>
- All Implemented Interfaces:
BigraphBuilder<S>
- Direct Known Subclasses:
KindBigraphBuilder
,MutableBuilder
BigraphBuilder
for pure bigraphs.
This bigraph builder offers a multi-scale approach for building bigraphs. From top to bottom. Beginning with the outer and inner names. Create places and connect on the fly.
- Author:
- Dominik Grzelak
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
A bigraph consists of many node hierarchy.Nested classes/interfaces inherited from class org.bigraphs.framework.core.BigraphBuilderSupport
BigraphBuilderSupport.InstanceParameter
Nested 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.EObject
protected org.eclipse.emf.ecore.EPackage
Fields inherited from class org.bigraphs.framework.core.BigraphBuilderSupport
DEFAULT_EDGE_PREFIX, DEFAULT_VERTEX_PREFIX
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PureBigraphBuilder
(org.eclipse.emf.ecore.EObject signatureMetaModel) protected
PureBigraphBuilder
(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath) protected
PureBigraphBuilder
(org.eclipse.emf.ecore.EObject signatureInstanceModel, String metaModelFilePath, String instanceModelFilePath) protected
PureBigraphBuilder
(org.eclipse.emf.ecore.EObject signatureMetaModel, EMetaModelData metaModelData) protected
PureBigraphBuilder
(org.eclipse.emf.ecore.EObject signatureMetaModel, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) protected
PureBigraphBuilder
(S signature) protected
PureBigraphBuilder
(S signature, String metaModelFilePath) protected
PureBigraphBuilder
(S signature, String metaModelFilePath, String instanceModelFilePath) protected
PureBigraphBuilder
(S signature, EMetaModelData metaModelData) protected
PureBigraphBuilder
(S signature, org.eclipse.emf.ecore.EPackage metaModel, String instanceModelFilePath) protected
PureBigraphBuilder
(S signature, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInnerNameTo
(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) Connects the inner nametoAttach
toinnerName
via alink (i.e., an edge or outer name).void
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).protected void
Clears 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.Closes all outer names.void
closeInnerName
(String innerName, boolean keepIdleName) Convenient method forcloseInnerName(BigraphEntity.InnerName, boolean)
void
closeInnerName
(BigraphEntity.InnerName innerName) Convenient method forcloseInnerName(BigraphEntity.InnerName, boolean)
.void
closeInnerName
(BigraphEntity.InnerName innerName, boolean keepIdleName) void
closeInnerNames
(BigraphEntity.InnerName... innerName) void
closeOuterName
(String outerName, boolean keepIdleName) Convenient method forcloseOuterName(BigraphEntity.OuterName, boolean)
void
closeOuterName
(BigraphEntity.OuterName outerName) Closes the outer name by removing all connections and the outer name itself.void
closeOuterName
(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.Edge
connectByEdge
(BigraphEntity.NodeEntity<Control>... nodes) connectInnerNames
(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2) Convenient method ofconnectInnerNames(BigraphEntity.InnerName, BigraphEntity.InnerName, boolean)
which doesn't keep idle edges when inner names are already connected to a node.connectInnerNames
(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2, boolean keepIdleEdges) Connects two existing inner names by an edge.protected void
connectInnerToLink
(BigraphEntity.InnerName innerName, BigraphEntity.Link edge) connectInnerToOuterName
(BigraphEntity innerName, BigraphEntity outerName) Connects an inner name to an outer name.protected void
connectInnerToOuterName0
(BigraphEntity innerName, BigraphEntity outerName) Ecore specific - only called by methods of this builder internallyvoid
connectNodeToInnerName
(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName innerName) Link a node with an inner name by an edgevoid
connectNodeToInnerNames
(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.InnerName... innerNames) Link multiple inner names by an edge to one nodeprotected void
connectNodeToOuterName
(BigraphEntity.NodeEntity<Control> node1, BigraphEntity.OuterName outerName) Helper method to connect a node to an outer name.protected void
connectToEdge
(BigraphEntity.NodeEntity<Control> node, BigraphEntity.Edge edge) no checks are done here... useisConnectedWithLink(BigraphEntity.NodeEntity, EObject)
protected void
connectToLinkUsingIndex
(BigraphEntity.NodeEntity<Control> node, BigraphEntity theLink, int customPortIndex) 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) 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>create
(@NonNull S signature, @NonNull org.eclipse.emf.ecore.EPackage bigraphMetaModel, String instanceModelFilePath) 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, org.eclipse.emf.ecore.EPackage metaModel, org.eclipse.emf.ecore.EObject instanceModel) protected BigraphEntity.Edge
Creates an edge of EClassde.tudresden.inf.st.bigraphs.models.bigraphBaseModel.BEdge
and adds it to the list of available edgesavailableEdges
.protected BigraphEntity.Edge
createEdgeOfEClass
(org.eclipse.emf.ecore.EObject eObject) protected org.eclipse.emf.ecore.EObject
createEdgeOfEClass0
(String edgeName) createInnerName
(String name) Returns the same inner name if it already exists under the samename
protected org.eclipse.emf.ecore.EObject
protected org.eclipse.emf.ecore.EObject
createNodeOfEClass
(String name, @NonNull Control control) protected org.eclipse.emf.ecore.EObject
createNodeOfEClass
(String name, @NonNull Control control, String nodeIdentifier) createOuterName
(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.EObject
protected org.eclipse.emf.ecore.EObject
createPortWithIndex
(int index) Helper method that creates a bigraphical portEObject
with the given index.Create a root node under which additional nodes or hierarchies can be place.protected org.eclipse.emf.ecore.EObject
createRootOfEClass
(int index) protected org.eclipse.emf.ecore.EObject
createSiteOfEClass
(int index) protected org.eclipse.emf.ecore.EObject
org.eclipse.emf.ecore.EPackage
Creates a new independent hierarchy which can be added later.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.void
loadSignatureMetaModel
(String metaModelFilePath) Does not re-create control nodes of typeEClass
because it directly uses the bigraphical Ecore metamodel.void
Converts the current bigraph to a ground bigraph (i.e., no sites an no inner names).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, isOuterName, 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
-
spawnNewOne
Description copied from interface:BigraphBuilder
Spawns 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:
instanceModelFilePath
- file path to the instance modelmetaModelFilePath
- the file to the Ecore meta modelsignature
- the signature for the builder and the generated bigraph- 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 typeS
BigraphMetaModelLoadingFailedException
-
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 typeS
BigraphMetaModelLoadingFailedException
-
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 typeS
BigraphMetaModelLoadingFailedException
-
getMetaModel
public org.eclipse.emf.ecore.EPackage getMetaModel()- Specified by:
getMetaModel
in classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
getInstanceModel
protected org.eclipse.emf.ecore.EObject getInstanceModel()- Specified by:
getInstanceModel
in classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
getAvailableEClasses
- Specified by:
getAvailableEClasses
in classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
getAvailableEReferences
- Specified by:
getAvailableEReferences
in classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,
?>>>
-
createRoot
Description copied from interface:BigraphBuilder
Create 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.NodeHierarchy
provides additional methods for adding nodes and sites. The hierarchy can only be used with theBigraphBuilder
which 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
-
createOuterName
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
-
createInnerName
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
-
connectInnerToOuterName
public PureBigraphBuilder<S> connectInnerToOuterName(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
-
connectInnerToOuterName0
Ecore specific - only called by methods of this builder internally- Parameters:
innerName
- the inner nameouterName
- the outer name
-
connectNodeToInnerName
public void connectNodeToInnerName(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
-
connectNodeToInnerNames
public void connectNodeToInnerNames(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
-
addInnerNameTo
public void addInnerNameTo(BigraphEntity.InnerName innerName, BigraphEntity.InnerName toAttach) throws LinkTypeNotExistsException, InvalidConnectionException Connects the inner nametoAttach
toinnerName
via alink (i.e., an edge or outer name). IfinnerName
is 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 withtoAttach
via a new link, or an existing onetoAttach
- the inner name that shall be linked withinnerName
via a new link, or an existing one frominnerName
- Throws:
LinkTypeNotExistsException
InvalidConnectionException
-
connectInnerNames
public PureBigraphBuilder<S> connectInnerNames(BigraphEntity.InnerName ecoreInnerName1, BigraphEntity.InnerName ecoreInnerName2) throws InvalidConnectionException Convenient method ofconnectInnerNames(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.
-
connectInnerNames
public PureBigraphBuilder<S> connectInnerNames(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
keepIdleEdges
decides 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 portEObject
with 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
, thenfalse
is 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 EClassde.tudresden.inf.st.bigraphs.models.bigraphBaseModel.BEdge
and adds it to the list of available edgesavailableEdges
.- Returns:
- the freshly created edge
-
createEdgeOfEClass
-
createBigraph
-
makeGround
public void makeGround()Converts the current bigraph to a ground bigraph (i.e., no sites an no inner names). -
closeAllInnerNames
Closes all inner names and doesn't keep idle edges and idle inner names. -
closeInnerNames
- Throws:
LinkTypeNotExistsException
-
closeInnerName
Convenient method forcloseInnerName(BigraphEntity.InnerName, boolean)
- Throws:
TypeNotExistsException
-
closeInnerName
Convenient method forcloseInnerName(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.
-
closeInnerName
public void closeInnerName(BigraphEntity.InnerName innerName, boolean keepIdleName) throws LinkTypeNotExistsException - Specified by:
closeInnerName
in classBigraphBuilderSupport<S extends AbstractEcoreSignature<? extends Control<?,
?>>> - Throws:
LinkTypeNotExistsException
-
closeAllOuterNames
Closes all outer names. SeecloseOuterName(BigraphEntity.OuterName)
. -
closeOuterName
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
-
closeOuterName
Convenient method forcloseOuterName(BigraphEntity.OuterName, boolean)
- Throws:
TypeNotExistsException
-
closeOuterName
public void closeOuterName(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; andfalse
to remove- Throws:
TypeNotExistsException
- if the passed outer name is not contained in the bigraph
-
loadSignatureMetaModel
Does not re-create control nodes of typeEClass
because 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
.
-