| 1 | package de.uka.ipd.sdq.dsexplore.analysis.lqn; |
| 2 | |
| 3 | import org.opt4j.core.Constraint; |
| 4 | import org.opt4j.core.Criterion; |
| 5 | import org.opt4j.core.Objective; |
| 6 | import org.opt4j.core.Constraint.Direction; |
| 7 | import org.opt4j.core.Objective.Sign; |
| 8 | |
| 9 | import de.uka.ipd.sdq.dsexplore.analysis.AbstractPerformanceAnalysisResult; |
| 10 | import de.uka.ipd.sdq.pcm.resultdecorator.ResultDecoratorRepository; |
| 11 | import de.uka.ipd.sdq.pcmsolver.models.PCMInstance; |
| 12 | import de.uka.ipd.sdq.statistics.estimation.ConfidenceInterval; |
| 13 | |
| 14 | public class LQNNotConvergedResult extends AbstractPerformanceAnalysisResult implements ILQNResult{ |
| 15 | |
| 16 | public LQNNotConvergedResult(PCMInstance model) { |
| 17 | super(model); |
| 18 | } |
| 19 | |
| 20 | @Override |
| 21 | public double getCoefficientOfVariance() { |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | @Override |
| 26 | public ConfidenceInterval getConfidenceInterval() { |
| 27 | return null; |
| 28 | } |
| 29 | |
| 30 | @Override |
| 31 | public double getMedianValue() { |
| 32 | return Double.POSITIVE_INFINITY; |
| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | public long getNumberOfObservations() { |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | @Override |
| 41 | public double getStandardDeviation() { |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public double getMeanValue() { |
| 47 | return Double.POSITIVE_INFINITY; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public double getValueFor(Criterion criterion) { |
| 52 | if (criterion instanceof Objective){ |
| 53 | if (((Objective)criterion).getSign() == Sign.MIN){ |
| 54 | return Double.POSITIVE_INFINITY; |
| 55 | } else { |
| 56 | return Double.NEGATIVE_INFINITY; |
| 57 | } |
| 58 | } else if (criterion instanceof Constraint){ |
| 59 | if (((Constraint)criterion).getDirection() == Direction.less |
| 60 | || ((Constraint)criterion).getDirection() == Direction.lessOrEqual |
| 61 | || ((Constraint)criterion).getDirection() == Direction.equal){ |
| 62 | return Double.POSITIVE_INFINITY; |
| 63 | } else { |
| 64 | return Double.NEGATIVE_INFINITY; |
| 65 | } |
| 66 | } |
| 67 | return Double.POSITIVE_INFINITY; |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | public ResultDecoratorRepository getResults() { |
| 72 | return null; |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | public double getSquaredCoefficientOfVariance() { |
| 77 | return 0; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public double getVariance() { |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | } |