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/ft2galileo/Ft2GalileoTransformation.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/ft2galileo/Ft2GalileoTransformation.xtend')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend deleted file mode 100644 index 4a19e2cd..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ft2galileo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.AndGate | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.BasicEvent | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.ConstantDistribution | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.Distribution | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.ExponentialDistribution | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.FaultTree | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.Gate | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.KOfMGate | ||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.OrGate | ||
12 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent | ||
13 | import org.eclipse.xtend2.lib.StringConcatenationClient | ||
14 | |||
15 | class Ft2GalileoTransformation { | ||
16 | def toGalileo(FaultTree faultTree) ''' | ||
17 | toplevel "«faultTree.topEvent.name»"; | ||
18 | «FOR event : faultTree.events» | ||
19 | "«event.name»" «defineEvent(event)»; | ||
20 | «ENDFOR» | ||
21 | ''' | ||
22 | |||
23 | protected dispatch def defineEvent(BasicEvent basicEvent) { | ||
24 | // ft-diet (https://moves.rwth-aachen.de/ft-diet/) needs a dormancy factor. | ||
25 | '''«defineDistribution(basicEvent.distribution)» dorm=0.0''' | ||
26 | } | ||
27 | |||
28 | protected dispatch def StringConcatenationClient defineDistribution(ConstantDistribution distribution) { | ||
29 | '''p=«distribution.p»''' | ||
30 | } | ||
31 | |||
32 | protected dispatch def StringConcatenationClient defineDistribution(ExponentialDistribution distribution) { | ||
33 | '''lambda=«distribution.lambda»''' | ||
34 | } | ||
35 | |||
36 | protected dispatch def StringConcatenationClient defineDistribution(Distribution distribution) { | ||
37 | throw new IllegalArgumentException("Unknown distribution: " + distribution) | ||
38 | } | ||
39 | |||
40 | protected dispatch def StringConcatenationClient defineEvent(Gate gate) { | ||
41 | '''«defineGate(gate)» «FOR input : gate.inputEvents SEPARATOR " "»"«input.name»"«ENDFOR»''' | ||
42 | } | ||
43 | |||
44 | protected dispatch def StringConcatenationClient defineGate(AndGate gate) '''and''' | ||
45 | |||
46 | protected dispatch def StringConcatenationClient defineGate(OrGate gate) '''or''' | ||
47 | |||
48 | protected dispatch def StringConcatenationClient defineGate(KOfMGate gate) '''«gate.k»of«gate.inputEvents.size»''' | ||
49 | |||
50 | protected dispatch def StringConcatenationClient defineGate(Gate gate) { | ||
51 | throw new IllegalArgumentException("Unknown gate: " + gate) | ||
52 | } | ||
53 | |||
54 | protected dispatch def StringConcatenationClient defineEvent(RandomEvent randomEvent) { | ||
55 | throw new IllegalArgumentException("Unknown random even: " + randomEvent) | ||
56 | } | ||
57 | } | ||