1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.probfunction.math.impl; |
5 | |
6 | import de.uka.ipd.sdq.probfunction.math.IProbabilityFunction; |
7 | import de.uka.ipd.sdq.probfunction.math.IProbabilityFunctionFactory; |
8 | import de.uka.ipd.sdq.probfunction.math.IRandomGenerator; |
9 | import de.uka.ipd.sdq.probfunction.math.IUnit; |
10 | |
11 | /** |
12 | * @author Ihssane |
13 | * |
14 | */ |
15 | public abstract class ProbabilityFunctionImpl implements IProbabilityFunction { |
16 | |
17 | private IUnit unit; |
18 | private boolean hasOrderedDomain; |
19 | private boolean isInFrequencyDomain; |
20 | public IRandomGenerator randomGenerator; |
21 | |
22 | protected static final IProbabilityFunctionFactory pfFactory = ProbabilityFunctionFactoryImpl.getInstance(); |
23 | |
24 | |
25 | public ProbabilityFunctionImpl(IUnit unit, boolean hasOrderedDomain, boolean isInFrequencyDomain) { |
26 | super(); |
27 | this.unit = unit; |
28 | this.hasOrderedDomain = hasOrderedDomain; |
29 | this.isInFrequencyDomain = isInFrequencyDomain; |
30 | } |
31 | |
32 | // // hide constructor |
33 | // private ProbabilityFunctionImpl() |
34 | // { |
35 | // |
36 | // } |
37 | |
38 | |
39 | public IUnit getUnit() { |
40 | return unit; |
41 | } |
42 | |
43 | |
44 | public boolean hasOrderedDomain() { |
45 | return hasOrderedDomain; |
46 | } |
47 | |
48 | |
49 | public boolean isInFrequencyDomain() { |
50 | return isInFrequencyDomain; |
51 | } |
52 | |
53 | |
54 | public boolean isInTimeDomain() { |
55 | return !isInFrequencyDomain; |
56 | } |
57 | |
58 | protected void setInFrequencyDomain(boolean isInFrequencyDomain) { |
59 | this.isInFrequencyDomain = isInFrequencyDomain; |
60 | } |
61 | |
62 | protected void setUnit(IUnit unit) { |
63 | this.unit = unit; |
64 | } |
65 | |
66 | /** |
67 | * @return the randomGenerator |
68 | */ |
69 | public IRandomGenerator getRandomGenerator() { |
70 | return randomGenerator; |
71 | } |
72 | |
73 | /** |
74 | * @param randomGenerator the randomGenerator to set |
75 | */ |
76 | public void setRandomGenerator(IRandomGenerator randomGenerator) { |
77 | this.randomGenerator = randomGenerator; |
78 | } |
79 | |
80 | |
81 | |
82 | } |