EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]

COVERAGE SUMMARY FOR SOURCE FILE [BinomialDistribution.java]

nameclass, %method, %block, %line, %
BinomialDistribution.java0%   (0/1)0%   (0/12)0%   (0/82)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BinomialDistribution0%   (0/1)0%   (0/12)0%   (0/82)0%   (0/18)
BinomialDistribution (int, double): void 0%   (0/1)0%   (0/10)0%   (0/3)
getArithmeticMeanValue (): double 0%   (0/1)0%   (0/3)0%   (0/1)
getLowerDomainBorder (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getMean (): double 0%   (0/1)0%   (0/15)0%   (0/3)
getMedian (): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getPercentile (int): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getProbability (): double 0%   (0/1)0%   (0/5)0%   (0/1)
getStandardDeviation (): double 0%   (0/1)0%   (0/20)0%   (0/3)
getTrials (): int 0%   (0/1)0%   (0/5)0%   (0/1)
getXinf (): double 0%   (0/1)0%   (0/2)0%   (0/1)
getXsup (): double 0%   (0/1)0%   (0/6)0%   (0/1)
hasOrderedDomain (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.probfunction.math.apache.impl;
5 
6 
7import org.apache.commons.math.distribution.BinomialDistributionImpl;
8 
9 
10import de.uka.ipd.sdq.probfunction.math.IBinomialDistribution;
11import de.uka.ipd.sdq.probfunction.math.exception.DomainNotNumbersException;
12import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInTimeDomainException;
13 
14import de.uka.ipd.sdq.probfunction.math.exception.UnorderedDomainException;
15 
16/**
17 * @author joerg
18 *
19 */
20public class BinomialDistribution extends AbstractDiscretePDF implements IBinomialDistribution
21{
22        
23        public BinomialDistribution(int trials, double p) 
24        {
25                this.internalFunction = new BinomialDistributionImpl(trials, p);
26        }
27 
28        /* (non-Javadoc)
29         * @see de.uka.ipd.sdq.probfunction.math.IContinousPDF#getStandardDeviation()
30         */
31        @Override
32        public double getStandardDeviation() 
33        {
34                int n = ((BinomialDistributionImpl)internalFunction).getNumberOfTrials();
35                double p = ((BinomialDistributionImpl)internalFunction).getProbabilityOfSuccess();
36                return Math.sqrt(n*p*(1-p));
37        }
38 
39        /* (non-Javadoc)
40         * @see de.uka.ipd.sdq.probfunction.math.IContinousPDF#getXinf()
41         */
42        @Override
43        public double getXinf() {
44                return 0;
45        }
46 
47        /* (non-Javadoc)
48         * @see de.uka.ipd.sdq.probfunction.math.IContinousPDF#getXsup()
49         */
50        @Override
51        public double getXsup() {
52                
53                return ((BinomialDistributionImpl)internalFunction).getNumberOfTrials();
54        }
55 
56        
57        /* (non-Javadoc)
58         * @see de.uka.ipd.sdq.probfunction.math.IProbabilityFunction#getArithmeticMeanValue()
59         */
60        @Override
61        public double getArithmeticMeanValue() throws DomainNotNumbersException,
62                        FunctionNotInTimeDomainException {
63                return getMean();
64        }
65 
66        /* (non-Javadoc)
67         * @see de.uka.ipd.sdq.probfunction.math.IProbabilityFunction#getMedian()
68         */
69        @Override
70        public Object getMedian() throws UnorderedDomainException {
71                throw new UnsupportedOperationException();
72        }
73 
74        /* (non-Javadoc)
75         * @see de.uka.ipd.sdq.probfunction.math.IProbabilityFunction#getPercentile(int)
76         */
77        @Override
78        public Object getPercentile(int p) throws IndexOutOfBoundsException,
79                        UnorderedDomainException {
80                throw new UnsupportedOperationException();
81        }
82 
83        /* (non-Javadoc)
84         * @see de.uka.ipd.sdq.probfunction.math.IProbabilityFunction#hasOrderedDomain()
85         */
86        @Override
87        public boolean hasOrderedDomain() {
88                throw new UnsupportedOperationException();
89        }
90 
91        @Override
92        public double getLowerDomainBorder() {
93                throw new UnsupportedOperationException();
94        }
95 
96        
97 
98        @Override
99        public double getMean() {
100                int n = ((BinomialDistributionImpl)internalFunction).getNumberOfTrials();
101                double p = ((BinomialDistributionImpl)internalFunction).getProbabilityOfSuccess();
102                return n*p;
103        }
104 
105        @Override
106        public double getProbability() {
107                
108                return ((BinomialDistributionImpl)internalFunction).getProbabilityOfSuccess();
109        }
110 
111        @Override
112        public int getTrials() {
113        
114                return ((BinomialDistributionImpl)internalFunction).getNumberOfTrials();
115        }
116 
117}

[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov