mean;
52 |
53 |
54 | /**
55 | * Creates a generator of Poisson-distributed values. The mean is
56 | * determined by the provided {org.uncommons.maths.number.NumberGenerator}. This means that
57 | * the statistical parameters of this generator may change over time.
58 | * One example of where this is useful is if the mean generator is attached
59 | * to a GUI control that allows a user to tweak the parameters while a
60 | * program is running.
61 | * To create a Poisson generator with a constant mean, use the
62 | * {@link #PoissonGenerator(double, Random)} constructor instead.
63 | * @param mean A {@link NumberGenerator} that provides the mean of the
64 | * Poisson distribution used for the next generated value.
65 | * @param rng The source of randomness.
66 | */
67 | public PoissonGenerator(NumberGenerator mean,
68 | Random rng)
69 | {
70 | this.mean = mean;
71 | this.rng = rng;
72 | }
73 |
74 |
75 | /**
76 | * Creates a generator of Poisson-distributed values from a distribution
77 | * with the specified mean.
78 | * @param mean The mean of the values generated.
79 | * @param rng The source of randomness.
80 | */
81 | public PoissonGenerator(double mean,
82 | Random rng)
83 | {
84 | this(new ConstantGenerator(mean), rng);
85 | if (mean <= 0)
86 | {
87 | throw new IllegalArgumentException("Mean must be a positive value.");
88 | }
89 | }
90 |
91 |
92 | /**
93 | * {@inheritDoc}
94 | */
95 | public Integer nextValue()
96 | {
97 | int x = 0;
98 | double t = 0.0;
99 | while (true)
100 | {
101 | t -= Math.log(rng.nextDouble()) / mean.nextValue();
102 | if (t > 1.0)
103 | {
104 | break;
105 | }
106 | ++x;
107 | }
108 | return x;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/src/main/resources/Angle0.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle0.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle104.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle104.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle120.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle120.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle135.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle135.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle156.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle156.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle180.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle180.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle208.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle208.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle225.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle225.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle240.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle240.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle260.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle260.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle270.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle270.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle300.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle300.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle312.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle312.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle315.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle315.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle45.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle45.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle52.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle52.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle60.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle60.tif
--------------------------------------------------------------------------------
/src/main/resources/Angle90.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PreibischLab/multiview-simulation/37cf879923a0c3515679cc0f66f7651636e91b61/src/main/resources/Angle90.tif
--------------------------------------------------------------------------------