1 | package de.uka.ipd.sdq.reliability.solver.reporting; |
2 | |
3 | /** |
4 | * Class used for aggregation of failure probabilities according to a |
5 | * FailureAnalysisFailureType when considering failure categories (classes). |
6 | * |
7 | * @author Daniel Patejdl |
8 | * |
9 | */ |
10 | public class ClassesFailureProbabilityAggregation { |
11 | /** |
12 | * The aggregated failure probability. |
13 | */ |
14 | private double failureProbability; |
15 | |
16 | /** |
17 | * The failure analysis failure type. The type may be used to distinguish |
18 | * several instances of this class. |
19 | */ |
20 | private FailureAnalysisFailureType failureType; |
21 | |
22 | /** |
23 | * Creates a new instance of this class, given the failure analysis failure |
24 | * type. |
25 | * |
26 | * @param failureAggregationType |
27 | */ |
28 | public ClassesFailureProbabilityAggregation( |
29 | FailureAnalysisFailureType failureType) { |
30 | this.failureType = failureType; |
31 | } |
32 | |
33 | /** |
34 | * Adds to the current aggregated failure probability additional failure |
35 | * probability. |
36 | * |
37 | * @param failureProbability |
38 | * the failure probability to be added to the existing one |
39 | */ |
40 | public void addToFailureProbabilityBy(double failureProbability) { |
41 | this.failureProbability += failureProbability; |
42 | } |
43 | |
44 | /** |
45 | * Retrieves the aggregated failure probability. |
46 | * |
47 | * @return the aggregated failure probability |
48 | */ |
49 | public double getFailureProbability() { |
50 | return failureProbability; |
51 | } |
52 | |
53 | /** |
54 | * Returns the failure type. |
55 | * |
56 | * @return the failure type |
57 | */ |
58 | public FailureAnalysisFailureType getType() { |
59 | return failureType; |
60 | } |
61 | |
62 | /** |
63 | * Sets the failure type. |
64 | * |
65 | * @param failureAggregationType |
66 | * the failure type |
67 | */ |
68 | public void setType(FailureAnalysisFailureType failureType) { |
69 | this.failureType = failureType; |
70 | } |
71 | } |