EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler]

COVERAGE SUMMARY FOR SOURCE FILE [PerformanceSymbolHandler.java]

nameclass, %method, %block, %line, %
PerformanceSymbolHandler.java0%   (0/1)0%   (0/5)0%   (0/60)0%   (0/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PerformanceSymbolHandler0%   (0/1)0%   (0/5)0%   (0/60)0%   (0/20)
PerformanceSymbolHandler (Hashtable, int): void 0%   (0/1)0%   (0/7)0%   (0/3)
PerformanceSymbolHandler (int): void 0%   (0/1)0%   (0/9)0%   (0/4)
getPdfTable (): Hashtable 0%   (0/1)0%   (0/3)0%   (0/1)
handle (Symbol): void 0%   (0/1)0%   (0/37)0%   (0/10)
setPdfTable (Hashtable): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler;
2 
3import java.util.Hashtable;
4 
5import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
6import de.uka.ipd.sdq.probfunction.math.IProbabilityFunctionFactory;
7import de.uka.ipd.sdq.probfunction.math.ISamplePDF;
8import de.uka.ipd.sdq.probfunction.math.exception.ProbabilityFunctionException;
9import de.uka.ipd.sdq.spa.basicsolver.visitor.SymbolHandler;
10import de.uka.ipd.sdq.spa.expression.Expression;
11import de.uka.ipd.sdq.spa.expression.Symbol;
12import de.uka.ipd.sdq.spa.resourcemodel.ResourceUsage;
13 
14/**
15 * @author Ihssane
16 * 
17 */
18public class PerformanceSymbolHandler implements SymbolHandler {
19 
20        private Hashtable<Expression, IProbabilityDensityFunction> pdfTable;
21 
22        private IProbabilityFunctionFactory pfFactory = IProbabilityFunctionFactory.eINSTANCE;
23 
24        private int domainSize;
25 
26        protected PerformanceSymbolHandler(
27                        Hashtable<Expression, IProbabilityDensityFunction> pdfTable, int domainSize) {
28                this(domainSize);
29                this.pdfTable = pdfTable;
30        }
31 
32        protected PerformanceSymbolHandler(int domainSize) {
33                super();
34                this.domainSize = domainSize;
35        }
36 
37        public void handle(Symbol symbol) {
38 
39                try {
40                        ResourceUsage resourceUsage = (ResourceUsage) symbol.getResourceUsages().get(0);
41                        IProbabilityDensityFunction pdf = pfFactory.transformToPDF(resourceUsage.getUsageTime());
42                        ISamplePDF spdf = pfFactory.transformToSamplePDF(pdf);
43                        spdf.expand(domainSize);
44                        IProbabilityDensityFunction fftPDF = spdf.getFourierTransform();
45                        pdfTable.put(symbol, fftPDF);
46                } catch (ProbabilityFunctionException e) {
47                        e.printStackTrace();
48                        System.exit(1);
49                }
50        }
51 
52        public Hashtable<Expression, IProbabilityDensityFunction> getPdfTable() {
53                return pdfTable;
54        }
55 
56        public void setPdfTable(
57                        Hashtable<Expression, IProbabilityDensityFunction> pdfTable) {
58                this.pdfTable = pdfTable;
59        }
60 
61}

[all classes][de.uka.ipd.sdq.spa.basicsolver.visitor.perfhandler]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov