diff options
author | 2019-03-20 16:09:09 +0100 | |
---|---|---|
committer | 2019-03-20 16:09:09 +0100 | |
commit | 3f5aaab5025b8eb243f414b1c789085327df04f4 (patch) | |
tree | 156d9d95888fce6b003d73f509b9155e6b24555f /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit | |
parent | Fix ParseUtil to avoid breaking the .vql editor in Eclipse (diff) | |
download | VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.gz VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.zst VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.zip |
Fault tree transformation for partial models WIP
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit')
27 files changed, 96 insertions, 41 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin index 226e6227..f68d0464 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin index 54ba3d09..6aebfa85 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin index 175ae3f1..323f40b2 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin index db3a7e73..45b228d3 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore index 75154a4c..058cff19 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore | |||
@@ -6,3 +6,11 @@ | |||
6 | /.FaultTreeBuilder.java._trace | 6 | /.FaultTreeBuilder.java._trace |
7 | /.FaultModelBuilder.java._trace | 7 | /.FaultModelBuilder.java._trace |
8 | /.EventCollection.java._trace | 8 | /.EventCollection.java._trace |
9 | /.Cft2FtTransformation.xtendbin | ||
10 | /.EventCollection.xtendbin | ||
11 | /.EventMaterializer.xtendbin | ||
12 | /.FaultTreeBuilder.xtendbin | ||
13 | /Cft2FtTransformation.java | ||
14 | /EventCollection.java | ||
15 | /EventMaterializer.java | ||
16 | /FaultTreeBuilder.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java index ac1fc209..98a82b7d 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java | |||
@@ -22,6 +22,7 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.Gate; | |||
22 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.KOfMGate; | 22 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.KOfMGate; |
23 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.OrGate; | 23 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.OrGate; |
24 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent; | 24 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent; |
25 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
25 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; | 26 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; |
26 | import java.util.LinkedHashSet; | 27 | import java.util.LinkedHashSet; |
27 | import java.util.Map; | 28 | import java.util.Map; |
@@ -416,7 +417,8 @@ public class EventMaterializer { | |||
416 | final EventCollection.Builder builder = EventCollection.builder(); | 417 | final EventCollection.Builder builder = EventCollection.builder(); |
417 | EList<Connection> _incomingConnections = input.getIncomingConnections(); | 418 | EList<Connection> _incomingConnections = input.getIncomingConnections(); |
418 | for (final Connection connection : _incomingConnections) { | 419 | for (final Connection connection : _incomingConnections) { |
419 | { | 420 | boolean _isCurrentlyConnected = CftExtensions.isCurrentlyConnected(connection); |
421 | if (_isCurrentlyConnected) { | ||
420 | final Event materializedEvent = this.getOrMaterialize(connection.getOutput()); | 422 | final Event materializedEvent = this.getOrMaterialize(connection.getOutput()); |
421 | builder.add(materializedEvent); | 423 | builder.add(materializedEvent); |
422 | } | 424 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin index f705fefe..59a21d5c 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin index bab76345..0a5c81fe 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin index 257bfc56..87965646 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin index a1339a18..cd930545 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin index ba19d0fb..2f779ecb 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin index 1e8612b2..93bad7e0 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin index ebe80f2e..fde76cfd 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin index 03bd16f8..4754c634 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore index 33bb70d4..377aa872 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore | |||
@@ -7,3 +7,19 @@ | |||
7 | /.CftTransformation.java._trace | 7 | /.CftTransformation.java._trace |
8 | /.Ecore2CftTransformation.java._trace | 8 | /.Ecore2CftTransformation.java._trace |
9 | /.ComponentNameGenerator.java._trace | 9 | /.ComponentNameGenerator.java._trace |
10 | /.ComponentFaultTreeTrace.xtendbin | ||
11 | /.ComponentInstanceTrace.xtendbin | ||
12 | /.ComponentNameGenerator.xtendbin | ||
13 | /.Ecore2CftTransformation.xtendbin | ||
14 | /.InputTrace.xtendbin | ||
15 | /.LookupHandler.xtendbin | ||
16 | /.MappingHandler.xtendbin | ||
17 | /.MappingQueries.xtendbin | ||
18 | /ComponentFaultTreeTrace.java | ||
19 | /ComponentInstanceTrace.java | ||
20 | /ComponentNameGenerator.java | ||
21 | /Ecore2CftTransformation.java | ||
22 | /InputTrace.java | ||
23 | /LookupHandler.java | ||
24 | /MappingHandler.java | ||
25 | /MappingQueries.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java index 46e711d9..ddcf9036 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java | |||
@@ -3,6 +3,7 @@ package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft; | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory; | 3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory; |
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; | 4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; |
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; | 5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; |
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentInstanceTrace; | 8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentInstanceTrace; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; |
@@ -24,13 +25,17 @@ public class ComponentFaultTreeTrace { | |||
24 | private final Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = CollectionLiterals.<IPatternMatch, ComponentInstanceTrace>newHashMap(); | 25 | private final Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = CollectionLiterals.<IPatternMatch, ComponentInstanceTrace>newHashMap(); |
25 | 26 | ||
26 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition) { | 27 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition) { |
28 | return this.instantiateComponent(patternMatch, componenDefinition, Modality.MUST, false); | ||
29 | } | ||
30 | |||
31 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition, final Modality exists, final boolean allowMultiple) { | ||
27 | ComponentInstanceTrace _xblockexpression = null; | 32 | ComponentInstanceTrace _xblockexpression = null; |
28 | { | 33 | { |
29 | boolean _containsKey = this.componentInstancesMap.containsKey(patternMatch); | 34 | boolean _containsKey = this.componentInstancesMap.containsKey(patternMatch); |
30 | if (_containsKey) { | 35 | if (_containsKey) { |
31 | throw new IllegalArgumentException(("Already instantiated component for match: " + patternMatch)); | 36 | throw new IllegalArgumentException(("Already instantiated component for match: " + patternMatch)); |
32 | } | 37 | } |
33 | final ComponentInstanceTrace componentTrace = new ComponentInstanceTrace(this.componentFaultTree, componenDefinition, this.nameGenerator); | 38 | final ComponentInstanceTrace componentTrace = new ComponentInstanceTrace(this.componentFaultTree, componenDefinition, this.nameGenerator, exists, allowMultiple); |
34 | this.componentInstancesMap.put(patternMatch, componentTrace); | 39 | this.componentInstancesMap.put(patternMatch, componentTrace); |
35 | _xblockexpression = componentTrace; | 40 | _xblockexpression = componentTrace; |
36 | } | 41 | } |
@@ -53,6 +58,11 @@ public class ComponentFaultTreeTrace { | |||
53 | " instead"); | 58 | " instead"); |
54 | throw new IllegalArgumentException(_plus_1); | 59 | throw new IllegalArgumentException(_plus_1); |
55 | } | 60 | } |
61 | boolean _appearsExactlyOnce = trace.appearsExactlyOnce(); | ||
62 | boolean _not = (!_appearsExactlyOnce); | ||
63 | if (_not) { | ||
64 | throw new IllegalArgumentException("Top level must appear in the fault tree exactly once"); | ||
65 | } | ||
56 | this.componentFaultTree.setTopEvent(IterableExtensions.<Output>head(outputs)); | 66 | this.componentFaultTree.setTopEvent(IterableExtensions.<Output>head(outputs)); |
57 | } | 67 | } |
58 | 68 | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java index 840f501d..4034bdf3 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java | |||
@@ -7,7 +7,9 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; | |||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration; | 8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration; |
9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; |
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 11 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
12 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; | 13 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; |
12 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.InputTrace; | 14 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.InputTrace; |
13 | import java.util.Map; | 15 | import java.util.Map; |
@@ -21,9 +23,11 @@ public class ComponentInstanceTrace { | |||
21 | 23 | ||
22 | private final Map<EventDeclaration, Output> outputEventsMap; | 24 | private final Map<EventDeclaration, Output> outputEventsMap; |
23 | 25 | ||
24 | protected ComponentInstanceTrace(final ComponentFaultTree faultTree, final ComponentDefinition componentDefinition, final ComponentNameGenerator nameGenerator) { | 26 | protected ComponentInstanceTrace(final ComponentFaultTree faultTree, final ComponentDefinition componentDefinition, final ComponentNameGenerator nameGenerator, final Modality exists, final boolean multipleAllowed) { |
25 | this.componentInstance.setComponentDefinition(componentDefinition); | 27 | this.componentInstance.setComponentDefinition(componentDefinition); |
26 | this.componentInstance.setName(nameGenerator.nextName(componentDefinition)); | 28 | this.componentInstance.setName(nameGenerator.nextName(componentDefinition)); |
29 | this.componentInstance.setExists(exists); | ||
30 | this.componentInstance.setMultipleAllowed(multipleAllowed); | ||
27 | this.inputEventsMap = Maps.<InputEvent, InputTrace>newHashMapWithExpectedSize(componentDefinition.getInputEvents().size()); | 31 | this.inputEventsMap = Maps.<InputEvent, InputTrace>newHashMapWithExpectedSize(componentDefinition.getInputEvents().size()); |
28 | EList<InputEvent> _inputEvents = componentDefinition.getInputEvents(); | 32 | EList<InputEvent> _inputEvents = componentDefinition.getInputEvents(); |
29 | for (final InputEvent inputEvent : _inputEvents) { | 33 | for (final InputEvent inputEvent : _inputEvents) { |
@@ -48,6 +52,10 @@ public class ComponentInstanceTrace { | |||
48 | } | 52 | } |
49 | 53 | ||
50 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent) { | 54 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent) { |
55 | this.assign(inputEvent, sourceComponent, outputEvent, Modality.MUST); | ||
56 | } | ||
57 | |||
58 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent, final Modality exists) { | ||
51 | final InputTrace inputTrace = this.inputEventsMap.get(inputEvent); | 59 | final InputTrace inputTrace = this.inputEventsMap.get(inputEvent); |
52 | if ((inputTrace == null)) { | 60 | if ((inputTrace == null)) { |
53 | throw new IllegalArgumentException(("Unknown input: " + inputEvent)); | 61 | throw new IllegalArgumentException(("Unknown input: " + inputEvent)); |
@@ -56,10 +64,14 @@ public class ComponentInstanceTrace { | |||
56 | if ((output == null)) { | 64 | if ((output == null)) { |
57 | throw new IllegalArgumentException(("Unknown output: " + outputEvent)); | 65 | throw new IllegalArgumentException(("Unknown output: " + outputEvent)); |
58 | } | 66 | } |
59 | inputTrace.assign(output); | 67 | inputTrace.assign(output, exists); |
60 | } | 68 | } |
61 | 69 | ||
62 | protected EList<Output> getOutputs() { | 70 | protected EList<Output> getOutputs() { |
63 | return this.componentInstance.getOutputs(); | 71 | return this.componentInstance.getOutputs(); |
64 | } | 72 | } |
73 | |||
74 | protected boolean appearsExactlyOnce() { | ||
75 | return CftExtensions.appearsExactlyOnce(this.componentInstance); | ||
76 | } | ||
65 | } | 77 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java index c12f2bae..2b30566f 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java | |||
@@ -5,7 +5,9 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Component; | |||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection; | 5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection; |
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input; | 6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
9 | import java.util.Map; | 11 | import java.util.Map; |
10 | import org.eclipse.emf.common.util.EList; | 12 | import org.eclipse.emf.common.util.EList; |
11 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 13 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
@@ -22,14 +24,20 @@ public class InputTrace { | |||
22 | _inputs.add(this.input); | 24 | _inputs.add(this.input); |
23 | } | 25 | } |
24 | 26 | ||
25 | public void assign(final Output output) { | 27 | public void assign(final Output output, final Modality exists) { |
26 | final Connection connection = this.connectionsMap.get(output); | 28 | final Connection connection = this.connectionsMap.get(output); |
27 | if ((connection == null)) { | 29 | if ((connection == null)) { |
28 | final Connection newConnection = CftFactory.eINSTANCE.createConnection(); | 30 | final Connection newConnection = CftFactory.eINSTANCE.createConnection(); |
29 | newConnection.setOutput(output); | 31 | newConnection.setOutput(output); |
32 | newConnection.setExists(exists); | ||
30 | EList<Connection> _incomingConnections = this.input.getIncomingConnections(); | 33 | EList<Connection> _incomingConnections = this.input.getIncomingConnections(); |
31 | _incomingConnections.add(newConnection); | 34 | _incomingConnections.add(newConnection); |
32 | this.connectionsMap.put(output, newConnection); | 35 | this.connectionsMap.put(output, newConnection); |
36 | } else { | ||
37 | boolean _isMoreConcreteThan = CftExtensions.isMoreConcreteThan(exists, connection.getExists()); | ||
38 | if (_isMoreConcreteThan) { | ||
39 | connection.setExists(exists); | ||
40 | } | ||
33 | } | 41 | } |
34 | } | 42 | } |
35 | } | 43 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin index 9fe75a0f..25ddc417 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore index 3f932890..f4610b04 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore | |||
@@ -1 +1,3 @@ | |||
1 | /.Ft2GalileoTransformation.java._trace | 1 | /.Ft2GalileoTransformation.java._trace |
2 | /.Ft2GalileoTransformation.xtendbin | ||
3 | /Ft2GalileoTransformation.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java index e900c62a..8748825d 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java | |||
@@ -19,18 +19,19 @@ import org.eclipse.xtend2.lib.StringConcatenationClient; | |||
19 | public class Ft2GalileoTransformation { | 19 | public class Ft2GalileoTransformation { |
20 | public CharSequence toGalileo(final FaultTree faultTree) { | 20 | public CharSequence toGalileo(final FaultTree faultTree) { |
21 | StringConcatenation _builder = new StringConcatenation(); | 21 | StringConcatenation _builder = new StringConcatenation(); |
22 | _builder.append("toplevel "); | 22 | _builder.append("toplevel \""); |
23 | String _name = faultTree.getTopEvent().getName(); | 23 | String _name = faultTree.getTopEvent().getName(); |
24 | _builder.append(_name); | 24 | _builder.append(_name); |
25 | _builder.append(";"); | 25 | _builder.append("\";"); |
26 | _builder.newLineIfNotEmpty(); | 26 | _builder.newLineIfNotEmpty(); |
27 | { | 27 | { |
28 | EList<RandomEvent> _events = faultTree.getEvents(); | 28 | EList<RandomEvent> _events = faultTree.getEvents(); |
29 | for(final RandomEvent event : _events) { | 29 | for(final RandomEvent event : _events) { |
30 | _builder.append("\""); | ||
30 | String _name_1 = event.getName(); | 31 | String _name_1 = event.getName(); |
31 | _builder.append(_name_1); | 32 | _builder.append(_name_1); |
32 | _builder.append(" "); | 33 | _builder.append("\" "); |
33 | StringConcatenationClient _defineEvent = this.defineEvent(event); | 34 | Object _defineEvent = this.defineEvent(event); |
34 | _builder.append(_defineEvent); | 35 | _builder.append(_defineEvent); |
35 | _builder.append(";"); | 36 | _builder.append(";"); |
36 | _builder.newLineIfNotEmpty(); | 37 | _builder.newLineIfNotEmpty(); |
@@ -39,8 +40,12 @@ public class Ft2GalileoTransformation { | |||
39 | return _builder; | 40 | return _builder; |
40 | } | 41 | } |
41 | 42 | ||
42 | protected StringConcatenationClient _defineEvent(final BasicEvent basicEvent) { | 43 | protected Object _defineEvent(final BasicEvent basicEvent) { |
43 | return this.defineDistribution(basicEvent.getDistribution()); | 44 | StringConcatenation _builder = new StringConcatenation(); |
45 | StringConcatenationClient _defineDistribution = this.defineDistribution(basicEvent.getDistribution()); | ||
46 | _builder.append(_defineDistribution); | ||
47 | _builder.append(" dorm=0.0"); | ||
48 | return _builder; | ||
44 | } | 49 | } |
45 | 50 | ||
46 | protected StringConcatenationClient _defineDistribution(final ConstantDistribution distribution) { | 51 | protected StringConcatenationClient _defineDistribution(final ConstantDistribution distribution) { |
@@ -87,8 +92,10 @@ public class Ft2GalileoTransformation { | |||
87 | } else { | 92 | } else { |
88 | _builder.appendImmediate(" ", ""); | 93 | _builder.appendImmediate(" ", ""); |
89 | } | 94 | } |
95 | _builder.append("\""); | ||
90 | String _name = input.getName(); | 96 | String _name = input.getName(); |
91 | _builder.append(_name); | 97 | _builder.append(_name); |
98 | _builder.append("\""); | ||
92 | } | 99 | } |
93 | } | 100 | } |
94 | } | 101 | } |
@@ -138,7 +145,7 @@ public class Ft2GalileoTransformation { | |||
138 | throw new IllegalArgumentException(("Unknown random even: " + randomEvent)); | 145 | throw new IllegalArgumentException(("Unknown random even: " + randomEvent)); |
139 | } | 146 | } |
140 | 147 | ||
141 | protected StringConcatenationClient defineEvent(final RandomEvent basicEvent) { | 148 | protected Object defineEvent(final RandomEvent basicEvent) { |
142 | if (basicEvent instanceof BasicEvent) { | 149 | if (basicEvent instanceof BasicEvent) { |
143 | return _defineEvent((BasicEvent)basicEvent); | 150 | return _defineEvent((BasicEvent)basicEvent); |
144 | } else if (basicEvent instanceof Gate) { | 151 | } else if (basicEvent instanceof Gate) { |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin index 57c4608d..552c946a 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin index f5cb52f4..a3f9c647 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin index 5dad0728..d7f66fd0 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin index abd8a501..b9fdf395 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore index 59cc8fe8..8a74c101 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore | |||
@@ -7,3 +7,14 @@ | |||
7 | /.StormDftException.java._trace | 7 | /.StormDftException.java._trace |
8 | /.ReliabilityModelSolution.java._trace | 8 | /.ReliabilityModelSolution.java._trace |
9 | /.ReliabilityResult.java._trace | 9 | /.ReliabilityResult.java._trace |
10 | /.ReliabilityResult.xtendbin | ||
11 | /.StormDftConfiguration.xtendbin | ||
12 | /.StormDftHandler.xtendbin | ||
13 | /.StormDftSolver.xtendbin | ||
14 | /ApproximationHeuristic.java | ||
15 | /FtAnalysisObjective.java | ||
16 | /ReliabilityResult.java | ||
17 | /StormDftConfiguration.java | ||
18 | /StormDftException.java | ||
19 | /StormDftHandler.java | ||
20 | /StormDftSolver.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java index 003d9cc5..46127425 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java | |||
@@ -16,15 +16,11 @@ import java.io.InputStreamReader; | |||
16 | import java.util.ArrayList; | 16 | import java.util.ArrayList; |
17 | import java.util.regex.Matcher; | 17 | import java.util.regex.Matcher; |
18 | import java.util.regex.Pattern; | 18 | import java.util.regex.Pattern; |
19 | import jnr.constants.platform.Signal; | ||
20 | import org.apache.commons.lang.SystemUtils; | ||
21 | import org.eclipse.xtend2.lib.StringConcatenation; | 19 | import org.eclipse.xtend2.lib.StringConcatenation; |
22 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 20 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
23 | import org.eclipse.xtext.xbase.lib.Conversions; | ||
24 | import org.eclipse.xtext.xbase.lib.Exceptions; | 21 | import org.eclipse.xtext.xbase.lib.Exceptions; |
25 | import org.eclipse.xtext.xbase.lib.Extension; | 22 | import org.eclipse.xtext.xbase.lib.Extension; |
26 | import org.eclipse.xtext.xbase.lib.Functions.Function0; | 23 | import org.eclipse.xtext.xbase.lib.Functions.Function0; |
27 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
28 | import org.eclipse.xtext.xbase.lib.InputOutput; | 24 | import org.eclipse.xtext.xbase.lib.InputOutput; |
29 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | 25 | import org.eclipse.xtext.xbase.lib.IterableExtensions; |
30 | 26 | ||
@@ -60,17 +56,11 @@ public class StormDftHandler { | |||
60 | 56 | ||
61 | private static final Pattern RESULT_PATTERN = Pattern.compile(StormDftHandler.RESULT_REGEX); | 57 | private static final Pattern RESULT_PATTERN = Pattern.compile(StormDftHandler.RESULT_REGEX); |
62 | 58 | ||
63 | private static final int SIGNAL_EXIT_VALUE_OFFSET = new Function0<Integer>() { | 59 | private static final int SIGNAL_EXIT_VALUE_OFFSET = 0x80; |
64 | public Integer apply() { | 60 | |
65 | int _xifexpression = (int) 0; | 61 | private static final int SIGXCPU = 24; |
66 | if (SystemUtils.IS_OS_SOLARIS) { | 62 | |
67 | _xifexpression = 0; | 63 | private static final int SIGXFSZ = 25; |
68 | } else { | ||
69 | _xifexpression = 0x80; | ||
70 | } | ||
71 | return _xifexpression; | ||
72 | } | ||
73 | }.apply().intValue(); | ||
74 | 64 | ||
75 | private static final int STORM_GENERAL_ERROR = ((-1) & 0xff); | 65 | private static final int STORM_GENERAL_ERROR = ((-1) & 0xff); |
76 | 66 | ||
@@ -305,9 +295,7 @@ public class StormDftHandler { | |||
305 | _matched=true; | 295 | _matched=true; |
306 | } | 296 | } |
307 | if (!_matched) { | 297 | if (!_matched) { |
308 | int _intValue = Signal.SIGXCPU.intValue(); | 298 | if (Objects.equal(exitValue, (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + StormDftHandler.SIGXCPU))) { |
309 | int _plus = (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + _intValue); | ||
310 | if (Objects.equal(exitValue, _plus)) { | ||
311 | _matched=true; | 299 | _matched=true; |
312 | } | 300 | } |
313 | } | 301 | } |
@@ -320,9 +308,7 @@ public class StormDftHandler { | |||
320 | _matched=true; | 308 | _matched=true; |
321 | } | 309 | } |
322 | if (!_matched) { | 310 | if (!_matched) { |
323 | int _intValue_1 = Signal.SIGXFSZ.intValue(); | 311 | if (Objects.equal(exitValue, (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + StormDftHandler.SIGXFSZ))) { |
324 | int _plus_1 = (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + _intValue_1); | ||
325 | if (Objects.equal(exitValue, _plus_1)) { | ||
326 | _matched=true; | 312 | _matched=true; |
327 | } | 313 | } |
328 | } | 314 | } |
@@ -334,14 +320,7 @@ public class StormDftHandler { | |||
334 | { | 320 | { |
335 | if ((exitValue > StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET)) { | 321 | if ((exitValue > StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET)) { |
336 | final int signalNumber = (exitValue - StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET); | 322 | final int signalNumber = (exitValue - StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET); |
337 | final Function1<Signal, Boolean> _function = (Signal it) -> { | 323 | throw new StormDftException(((("Storm unexpectedly killed by signal " + Integer.valueOf(signalNumber)) + ": ") + error)); |
338 | int _intValue_2 = it.intValue(); | ||
339 | return Boolean.valueOf((_intValue_2 == signalNumber)); | ||
340 | }; | ||
341 | final Signal signal = IterableExtensions.<Signal>findFirst(((Iterable<Signal>)Conversions.doWrapArray(Signal.values())), _function); | ||
342 | if ((signal != null)) { | ||
343 | throw new StormDftException(((("Storm unexpectedly killed by signal " + signal) + ": ") + error)); | ||
344 | } | ||
345 | } | 324 | } |
346 | throw new StormDftException(((("Storm unexpectedly exit with status " + Integer.valueOf(exitValue)) + ": ") + error)); | 325 | throw new StormDftException(((("Storm unexpectedly exit with status " + Integer.valueOf(exitValue)) + ": ") + error)); |
347 | } | 326 | } |