1 | package de.uka.ipd.sdq.stoex.analyser.operations; |
2 | |
3 | import de.uka.ipd.sdq.probfunction.math.IProbabilityMassFunction; |
4 | |
5 | /** |
6 | * Implements the operation "less than" for different kinds of operands. |
7 | * @author koziolek |
8 | */ |
9 | public class LessOperation extends CompareOperation { |
10 | |
11 | protected IProbabilityMassFunction getComparePMF(boolean left, boolean right) { |
12 | throw new UnsupportedOperationException(); |
13 | } |
14 | |
15 | protected IProbabilityMassFunction getComparePMF(double left, double right) { |
16 | if (left < right) |
17 | return getBoolPMF(1.0); |
18 | else |
19 | return getBoolPMF(0.0); |
20 | } |
21 | |
22 | protected IProbabilityMassFunction getComparePMF(double left, IProbabilityMassFunction right) { |
23 | return new GreaterOperation().compare(right, left); |
24 | } |
25 | |
26 | protected IProbabilityMassFunction getComparePMF(IProbabilityMassFunction left, double right) { |
27 | return getBoolPMF(getThresholdProbability(left, right, false)); |
28 | } |
29 | |
30 | protected IProbabilityMassFunction getComparePMF(IProbabilityMassFunction left, IProbabilityMassFunction right) { |
31 | return getBoolPMF(comparePointWise(left, right, this)); |
32 | } |
33 | |
34 | protected IProbabilityMassFunction getComparePMF(String left, IProbabilityMassFunction right) { |
35 | throw new UnsupportedOperationException(); |
36 | } |
37 | |
38 | protected IProbabilityMassFunction getComparePMF(String left, String right) { |
39 | throw new UnsupportedOperationException(); |
40 | } |
41 | |
42 | } |