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/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java | |
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/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java deleted file mode 100644 index 491e7fc1..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftSolver.java +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.transformation.solver; | ||
2 | |||
3 | import com.google.common.base.Objects; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.ConstantModel; | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.FaultTree; | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.ReliabilityModel; | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ft2galileo.Ft2GalileoTransformation; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.solver.FtAnalysisObjective; | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.solver.ReliabilityResult; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.solver.StormDftConfiguration; | ||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.solver.StormDftHandler; | ||
12 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace; | ||
13 | |||
14 | @SuppressWarnings("all") | ||
15 | public class StormDftSolver { | ||
16 | private static final String DFT_FILE_NAME = "ft.dft"; | ||
17 | |||
18 | private final Ft2GalileoTransformation ft2Galileo = new Ft2GalileoTransformation(); | ||
19 | |||
20 | private final StormDftHandler handler = new StormDftHandler(); | ||
21 | |||
22 | public ReliabilityResult solve(final ReliabilityModel reliabilityModel, final StormDftConfiguration configuration, final ReasonerWorkspace reasonerWorkspace) { | ||
23 | ReliabilityResult _switchResult = null; | ||
24 | boolean _matched = false; | ||
25 | if (reliabilityModel instanceof FaultTree) { | ||
26 | _matched=true; | ||
27 | _switchResult = this.solve(((FaultTree)reliabilityModel), configuration, reasonerWorkspace); | ||
28 | } | ||
29 | if (!_matched) { | ||
30 | if (reliabilityModel instanceof ConstantModel) { | ||
31 | _matched=true; | ||
32 | ReliabilityResult.Solution _xblockexpression = null; | ||
33 | { | ||
34 | double _xifexpression = (double) 0; | ||
35 | boolean _isFailed = ((ConstantModel)reliabilityModel).isFailed(); | ||
36 | if (_isFailed) { | ||
37 | _xifexpression = 0; | ||
38 | } else { | ||
39 | double _switchResult_1 = (double) 0; | ||
40 | final FtAnalysisObjective objective = configuration.objective; | ||
41 | boolean _matched_1 = false; | ||
42 | if (Objects.equal(objective, FtAnalysisObjective.MTTF)) { | ||
43 | _matched_1=true; | ||
44 | _switchResult_1 = Double.POSITIVE_INFINITY; | ||
45 | } | ||
46 | if (!_matched_1) { | ||
47 | if (objective instanceof FtAnalysisObjective.TimeBound) { | ||
48 | _matched_1=true; | ||
49 | _switchResult_1 = 1; | ||
50 | } | ||
51 | } | ||
52 | if (!_matched_1) { | ||
53 | throw new IllegalArgumentException(("Unknown objective: " + objective)); | ||
54 | } | ||
55 | _xifexpression = _switchResult_1; | ||
56 | } | ||
57 | final double result = _xifexpression; | ||
58 | _xblockexpression = new ReliabilityResult.Solution(result); | ||
59 | } | ||
60 | _switchResult = _xblockexpression; | ||
61 | } | ||
62 | } | ||
63 | if (!_matched) { | ||
64 | throw new IllegalArgumentException(("Unknown reliability model: " + reliabilityModel)); | ||
65 | } | ||
66 | return _switchResult; | ||
67 | } | ||
68 | |||
69 | public ReliabilityResult solve(final FaultTree faultTree, final StormDftConfiguration configuration, final ReasonerWorkspace reasonerWorkspace) { | ||
70 | ReliabilityResult _xblockexpression = null; | ||
71 | { | ||
72 | final CharSequence galileo = this.ft2Galileo.toGalileo(faultTree); | ||
73 | reasonerWorkspace.writeText(StormDftSolver.DFT_FILE_NAME, galileo); | ||
74 | final String dftFilePath = reasonerWorkspace.getFile(StormDftSolver.DFT_FILE_NAME).getAbsolutePath(); | ||
75 | _xblockexpression = this.handler.callSolver(dftFilePath, configuration); | ||
76 | } | ||
77 | return _xblockexpression; | ||
78 | } | ||
79 | } | ||