diff options
author | 2019-08-01 14:49:53 +0200 | |
---|---|---|
committer | 2019-08-01 14:49:53 +0200 | |
commit | 972baab642bd889d2c3476c0c9e17a6929e0c318 (patch) | |
tree | 8f724cb348c60e4fc45d446d8532988ed8e40748 /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend | |
parent | Counting scope propagator (simpler than BasicTypeHierarchy) (diff) | |
download | VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.gz VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.zst VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.zip |
[Stochastic] Remove fault tree support for now
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend deleted file mode 100644 index 10c91fb4..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality | ||
6 | import java.util.Map | ||
7 | import org.eclipse.viatra.query.runtime.api.IPatternMatch | ||
8 | import org.eclipse.xtend.lib.annotations.Accessors | ||
9 | |||
10 | class ComponentFaultTreeTrace { | ||
11 | @Accessors val componentFaultTree = CftFactory.eINSTANCE.createComponentFaultTree | ||
12 | |||
13 | val nameGenerator = new ComponentNameGenerator | ||
14 | val Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = newHashMap | ||
15 | |||
16 | def instantiateComponent(IPatternMatch patternMatch, ComponentDefinition componenDefinition) { | ||
17 | instantiateComponent(patternMatch, componenDefinition, Modality.MUST, false) | ||
18 | } | ||
19 | |||
20 | def instantiateComponent(IPatternMatch patternMatch, ComponentDefinition componenDefinition, Modality exists, | ||
21 | boolean allowMultiple) { | ||
22 | if (componentInstancesMap.containsKey(patternMatch)) { | ||
23 | throw new IllegalArgumentException("Already instantiated component for match: " + patternMatch) | ||
24 | } | ||
25 | val componentTrace = new ComponentInstanceTrace(componentFaultTree, componenDefinition, nameGenerator, | ||
26 | exists, allowMultiple) | ||
27 | componentInstancesMap.put(patternMatch, componentTrace) | ||
28 | componentTrace | ||
29 | } | ||
30 | |||
31 | def setTopLevel(ComponentInstanceTrace trace) { | ||
32 | if (componentFaultTree.topEvent !== null) { | ||
33 | throw new IllegalArgumentException("Top level component already set") | ||
34 | } | ||
35 | val outputs = trace.outputs | ||
36 | if (outputs.size !== 1) { | ||
37 | throw new IllegalArgumentException("Top level component must have 1 output, got " + outputs.size + | ||
38 | " instead") | ||
39 | } | ||
40 | if (!trace.appearsExactlyOnce) { | ||
41 | throw new IllegalArgumentException("Top level must appear in the fault tree exactly once") | ||
42 | } | ||
43 | componentFaultTree.topEvent = outputs.head | ||
44 | } | ||
45 | |||
46 | def lookup(IPatternMatch patternMatch) { | ||
47 | componentInstancesMap.get(patternMatch) | ||
48 | } | ||
49 | } | ||