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 [ExponentialDistribution.java]

nameclass, %method, %block, %line, %
ExponentialDistribution.java100% (1/1)12%  (3/24)15%  (17/112)21%  (6/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExponentialDistribution100% (1/1)12%  (3/24)15%  (17/112)21%  (6/28)
add (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
checkConstrains (): void 0%   (0/1)0%   (0/4)0%   (0/1)
div (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getArithmeticMeanValue (): double 0%   (0/1)0%   (0/5)0%   (0/1)
getCumulativeFunction (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getInverseFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getLowerDomainBorder (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getMedian (): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getPercentile (int): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getRate (): double 0%   (0/1)0%   (0/7)0%   (0/1)
getStandardDeviation (): double 0%   (0/1)0%   (0/7)0%   (0/2)
greaterThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
hasOrderedDomain (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
lessThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
mult (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
probabilisticEquals (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
scale (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
shiftDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
stretchDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/8)0%   (0/1)
sub (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
ExponentialDistribution (double): void 100% (1/1)100% (13/13)100% (4/4)
getXinf (): double 100% (1/1)100% (2/2)100% (1/1)
getXsup (): double 100% (1/1)100% (2/2)100% (1/1)

1package de.uka.ipd.sdq.probfunction.math.apache.impl;
2 
3import org.apache.commons.math.distribution.ExponentialDistributionImpl;
4//import umontreal.iro.lecuyer.probdist.ExponentialDist;
5import de.uka.ipd.sdq.probfunction.math.IExponentialDistribution;
6import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
7import de.uka.ipd.sdq.probfunction.math.exception.DomainNotNumbersException;
8import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInFrequencyDomainException;
9import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInTimeDomainException;
10import de.uka.ipd.sdq.probfunction.math.exception.FunctionsInDifferenDomainsException;
11import de.uka.ipd.sdq.probfunction.math.exception.IncompatibleUnitsException;
12import de.uka.ipd.sdq.probfunction.math.exception.InvalidSampleValueException;
13import de.uka.ipd.sdq.probfunction.math.exception.NegativeDistanceException;
14import de.uka.ipd.sdq.probfunction.math.exception.ProbabilityFunctionException;
15import de.uka.ipd.sdq.probfunction.math.exception.ProbabilitySumNotOneException;
16import de.uka.ipd.sdq.probfunction.math.exception.UnitNameNotSetException;
17import de.uka.ipd.sdq.probfunction.math.exception.UnitNotSetException;
18import de.uka.ipd.sdq.probfunction.math.exception.UnknownPDFTypeException;
19import de.uka.ipd.sdq.probfunction.math.exception.UnorderedDomainException;
20 
21/**
22 * Supports only the mean value so far. 
23 * 
24 * Some of the other methods could probably be provided. 
25 * 
26 * TODO: A number of calculations are possible, implement them instead of throwing UnsupportedOperationException().
27 * 
28 * See e.g. http://en.wikipedia.org/wiki/List_of_convolutions_of_probability_distributions
29 * @author martens
30 *
31 */
32public class ExponentialDistribution extends AbstractContinousPDF implements IExponentialDistribution {
33        
34        public ExponentialDistribution(double rate){
35                double mean = 1.0/rate;
36                this.internalFunction = new ExponentialDistributionImpl(mean);
37        }
38 
39        public IProbabilityDensityFunction add(IProbabilityDensityFunction pdf)
40                        throws FunctionsInDifferenDomainsException,
41                        UnknownPDFTypeException, IncompatibleUnitsException {
42                throw new UnsupportedOperationException();
43        }
44 
45        public IProbabilityDensityFunction div(IProbabilityDensityFunction pdf)
46                        throws FunctionsInDifferenDomainsException,
47                        UnknownPDFTypeException, IncompatibleUnitsException {
48                throw new UnsupportedOperationException();
49        }
50 
51        public IProbabilityDensityFunction getCumulativeFunction()
52                        throws FunctionNotInTimeDomainException {
53                throw new UnsupportedOperationException();
54        }
55 
56        public IProbabilityDensityFunction getFourierTransform()
57                        throws FunctionNotInTimeDomainException {
58                throw new UnsupportedOperationException();
59        }
60 
61        public IProbabilityDensityFunction getInverseFourierTransform()
62                        throws FunctionNotInFrequencyDomainException {
63                throw new UnsupportedOperationException();
64        }
65 
66        public double getLowerDomainBorder() {
67                throw new UnsupportedOperationException();
68        }
69 
70        public double greaterThan(IProbabilityDensityFunction pdf)
71                        throws ProbabilityFunctionException {
72                throw new UnsupportedOperationException();
73        }
74 
75        public double lessThan(IProbabilityDensityFunction pdf)
76                        throws ProbabilityFunctionException {
77                throw new UnsupportedOperationException();
78        }
79 
80        public IProbabilityDensityFunction mult(IProbabilityDensityFunction pdf)
81                        throws FunctionsInDifferenDomainsException,
82                        UnknownPDFTypeException, IncompatibleUnitsException {
83                throw new UnsupportedOperationException();
84        }
85 
86        public double probabilisticEquals(IProbabilityDensityFunction pdf)
87                        throws ProbabilityFunctionException {
88                throw new UnsupportedOperationException();
89        }
90 
91        public IProbabilityDensityFunction sub(IProbabilityDensityFunction pdf)
92                        throws FunctionsInDifferenDomainsException,
93                        UnknownPDFTypeException, IncompatibleUnitsException {
94                throw new UnsupportedOperationException();
95        }
96 
97        public void checkConstrains() throws NegativeDistanceException,
98                        ProbabilitySumNotOneException, FunctionNotInTimeDomainException,
99                        UnitNotSetException, UnitNameNotSetException,
100                        InvalidSampleValueException {
101                throw new UnsupportedOperationException();
102 
103        }
104 
105        public Object getMedian() throws UnorderedDomainException {
106                throw new UnsupportedOperationException();
107        }
108 
109        public Object getPercentile(int p) throws IndexOutOfBoundsException,
110                        UnorderedDomainException {
111                throw new UnsupportedOperationException();
112        }
113 
114        public boolean hasOrderedDomain() {
115                throw new UnsupportedOperationException();
116        }
117 
118        public double getRate() {
119                return 1.0/((ExponentialDistributionImpl)this.internalFunction).getMean();
120        }
121        
122        
123        public IProbabilityDensityFunction scale(double scalar) {
124                throw new UnsupportedOperationException();
125        }
126 
127        public IProbabilityDensityFunction shiftDomain(double scalar)
128                        throws DomainNotNumbersException {
129                throw new UnsupportedOperationException();
130        }
131 
132        public IProbabilityDensityFunction stretchDomain(double scalar) {
133                return new ExponentialDistribution(this.getRate() / scalar);
134        }
135 
136        @Override
137        public double getStandardDeviation() {
138                /**
139                 * Apache math uses the StandardDeviation as mean!
140                 */
141                final double m = ((ExponentialDistributionImpl)this.internalFunction).getMean();
142        return m;
143        }
144 
145        @Override
146        public double getXinf() {
147                return 0.0;
148        }
149 
150        @Override
151        public double getXsup() {
152                return Double.POSITIVE_INFINITY;
153        }
154 
155        
156 
157        @Override
158        public double getArithmeticMeanValue() throws DomainNotNumbersException,
159                        FunctionNotInTimeDomainException {
160                return ((ExponentialDistributionImpl)this.internalFunction).getMean();
161        }
162 
163 
164}

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