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

COVERAGE SUMMARY FOR SOURCE FILE [UniDoubleDistFunction.java]

nameclass, %method, %block, %line, %
UniDoubleDistFunction.java0%   (0/1)0%   (0/3)0%   (0/48)0%   (0/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UniDoubleDistFunction0%   (0/1)0%   (0/3)0%   (0/48)0%   (0/12)
UniDoubleDistFunction (IRandomGenerator, IPDFFactory): void 0%   (0/1)0%   (0/5)0%   (0/2)
checkParameters (List): boolean 0%   (0/1)0%   (0/20)0%   (0/6)
evaluate (List): Object 0%   (0/1)0%   (0/23)0%   (0/4)

1package de.uka.ipd.sdq.simucomframework.variables.functions;
2 
3import java.util.List;
4 
5import de.uka.ipd.sdq.probfunction.math.IPDFFactory;
6import de.uka.ipd.sdq.probfunction.math.IRandomGenerator;
7import de.uka.ipd.sdq.probfunction.math.IUniformDistribution;
8 
9import de.uka.ipd.sdq.simucomframework.variables.converter.NumberConverter;
10 
11public class UniDoubleDistFunction extends AbstractProbDistFunction {
12 
13        
14        public UniDoubleDistFunction(IRandomGenerator random, IPDFFactory factory) {
15                super(random, factory);
16        }
17 
18        public boolean checkParameters(List<Object> parameters) {
19                if (parameters.size() != 2)
20                        return false;
21                if (NumberConverter.toDouble(parameters.get(0)) > 
22                                NumberConverter.toDouble(parameters.get(1)))
23                        return false;
24                return true;
25        }
26 
27        public Object evaluate(List<Object> parameters) {
28                double a = NumberConverter.toDouble(parameters.get(0));
29                double b = NumberConverter.toDouble(parameters.get(1));
30                IUniformDistribution distribution = factory.createUniformDistribution(a, b);
31                return distribution.inverseF(randomGen.random());
32        }
33 
34}

[all classes][de.uka.ipd.sdq.simucomframework.variables.functions]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov