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

COVERAGE SUMMARY FOR SOURCE FILE [LQNSolverAnalysis.java]

nameclass, %method, %block, %line, %
LQNSolverAnalysis.java0%   (0/1)0%   (0/6)0%   (0/65)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LQNSolverAnalysis0%   (0/1)0%   (0/6)0%   (0/65)0%   (0/17)
LQNSolverAnalysis (): void 0%   (0/1)0%   (0/6)0%   (0/2)
getSolverMessageString (): String 0%   (0/1)0%   (0/2)0%   (0/1)
handleException (RuntimeException, PCMInstance): IAnalysisResult 0%   (0/1)0%   (0/28)0%   (0/7)
hasObjectivePerUsageScenario (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
hasStatisticResults (): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
retrieveResult (PCMInstance, LqnModelType, Criterion): ILQNResult 0%   (0/1)0%   (0/25)0%   (0/5)

1package de.uka.ipd.sdq.dsexplore.analysis.lqn;
2 
3import org.eclipse.core.runtime.CoreException;
4import org.opt4j.core.Criterion;
5 
6import LqnCore.LqnModelType;
7import de.uka.ipd.sdq.dsexplore.analysis.AnalysisFailedException;
8import de.uka.ipd.sdq.dsexplore.analysis.IAnalysisResult;
9import de.uka.ipd.sdq.pcmsolver.models.PCMInstance;
10import de.uka.ipd.sdq.pcmsolver.runconfig.MessageStrings;
11 
12/**
13 * Starts a LQN Solver Analysis for the design space exploration.
14 * 
15 * @author pmerkle
16 *
17 */
18public class LQNSolverAnalysis extends AbstractLQNAnalysis {
19        
20        boolean hasConverged = true;
21 
22        /**
23         * try to handle the exception or throw it back. 
24         * @param e
25         * @return
26         */
27        @Override
28        protected IAnalysisResult handleException(RuntimeException e, PCMInstance pcm) {
29                if (e.getMessage() != null && 
30                                (e.getMessage().contains("exited with 1: The model failed to converge."))
31                                || (e.getMessage().contains("Open arrival rate of ") 
32                                    && e.getMessage().contains("is too high."))){
33                        hasConverged = false;
34                        return new LQNNotConvergedResult(pcm);
35//                } else if (e.getMessage() != null && e.getMessage().contains("invalid input")){
36//                         String inputFileName = Pcm2LqnStrategy.FILENAME_INPUT_XML;
37//                         copyfile(inputFileName, inputFileName+"-invalidInput"+iteration);
38//                         throw e;
39//                } else if (e.getMessage() != null && e.getMessage().contains(" returned an unrecognised exit value")){
40//                         String inputFileName = Pcm2LqnStrategy.FILENAME_INPUT_XML;
41//                         copyfile(inputFileName, inputFileName+"-unrecognizedExit"+iteration);
42//                         throw e;
43                } else {
44                        throw e;
45                }
46                
47        }
48        
49        @Override
50        protected String getSolverMessageString() {
51                return MessageStrings.LQNS_SOLVER;
52        }
53 
54        @Override
55        public boolean hasStatisticResults() throws CoreException {
56                return false;
57        }
58        
59        @Override
60        protected ILQNResult retrieveResult(PCMInstance pcm,
61                        LqnModelType model, Criterion criterion) throws AnalysisFailedException {
62                ILQNResult result;
63                if (hasConverged){
64                        result = new LQNSolverAnalysisResult(model, pcm, criterion, this.criterionToAspect, this.lQNQualityAttribute);
65                } else {
66                        result = new LQNNotConvergedResult(pcm);
67                        hasConverged = true;
68                }
69                return result;
70        }
71        
72 
73        @Override
74        public boolean hasObjectivePerUsageScenario() throws CoreException {
75                return true;
76        }
77 
78        
79        
80}

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