EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.dsexplore.analysis.reliability]

COVERAGE SUMMARY FOR SOURCE FILE [ReliabilityAnalysisResult.java]

nameclass, %method, %block, %line, %
ReliabilityAnalysisResult.java0%   (0/1)0%   (0/4)0%   (0/38)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ReliabilityAnalysisResult0%   (0/1)0%   (0/4)0%   (0/38)0%   (0/14)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/3)
ReliabilityAnalysisResult (double, PCMSolverWorkflowRunConfiguration): void 0%   (0/1)0%   (0/29)0%   (0/9)
getUtilisationOfResource (ResourceContainer, ProcessingResourceSpecification)... 0%   (0/1)0%   (0/2)0%   (0/1)
getValueFor (Criterion): double 0%   (0/1)0%   (0/3)0%   (0/1)

1package de.uka.ipd.sdq.dsexplore.analysis.reliability;
2 
3import java.math.BigDecimal;
4import java.math.RoundingMode;
5 
6import org.apache.log4j.Logger;
7import org.opt4j.core.Criterion;
8 
9import de.uka.ipd.sdq.dsexplore.analysis.IAnalysisResult;
10import de.uka.ipd.sdq.pcm.resourceenvironment.ProcessingResourceSpecification;
11import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer;
12import de.uka.ipd.sdq.pcmsolver.runconfig.PCMSolverWorkflowRunConfiguration;
13 
14/**
15 * This class represents the result of a LQN Solver analysis. 
16 * 
17 * @author anne
18 *
19 */
20public class ReliabilityAnalysisResult implements IAnalysisResult {
21        
22        protected static Logger logger = Logger
23                        .getLogger("de.uka.ipd.sdq.dsexplore");
24        
25 
26        private double pofod;
27 
28        /**
29         * Store the reliability result. If the number of exact decimal places has been limited in the
30         * {@link PCMSolverWorkflowRunConfiguration}, the result is rounded to that value by cutting all following places. 
31         * @param d
32         * @param lastPCMSolverConfigurationconfiguration to determine whether to round the result. 
33         */
34        public ReliabilityAnalysisResult(double d, PCMSolverWorkflowRunConfiguration lastPCMSolverConfiguration) {
35                boolean limitedNumberOfExactDecimalPlaces = lastPCMSolverConfiguration.isNumberOfExactDecimalPlacesEnabled();
36                if (limitedNumberOfExactDecimalPlaces){
37                        // +1 to not loose any information, because the solver is accurate to at least the given number of places. 
38                        int numberOfPlaces = lastPCMSolverConfiguration.getNumberOfExactDecimalPlaces()+1;
39                        BigDecimal bigD = new BigDecimal(d);
40                        bigD = bigD.setScale(numberOfPlaces, RoundingMode.FLOOR);
41                        d = bigD.doubleValue();
42                }
43                this.pofod = d;
44        }
45 
46        /**
47         * {@inheritDoc}
48         * TODO: check correct criterion
49         */
50        @Override
51        public double getValueFor(Criterion criterion)  {
52                return this.pofod;
53 
54        }
55 
56 
57        /**
58         * Not applicable to Reliability results. 
59         * @return -1
60         */
61        public double getUtilisationOfResource(ResourceContainer container,
62                        ProcessingResourceSpecification resource)
63                         {
64                // TODO Implement
65                return -1;
66        }
67 
68}

[all classes][de.uka.ipd.sdq.dsexplore.analysis.reliability]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov