本文整理汇总了Java中org.apache.commons.math3.distribution.ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY属性的典型用法代码示例。如果您正苦于以下问题:Java ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY属性的具体用法?Java ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY怎么用?Java ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.distribution.ExponentialDistribution
的用法示例。
在下文中一共展示了ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateVMsRandom
public void generateVMsRandom(int totalVmNum) {
int vmCount = 0;
double lastStartTime = 0;
double startMean = 1800; // sec = 30min
double durScale=14400; // sec = 4 hours
double durShape=1.2;
Random rVmNum = new Random(seed);
ExponentialDistribution rStartTime = new ExponentialDistribution(new Well19937c(seed), startMean, ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
ParetoDistribution rDuration = new ParetoDistribution(new Well19937c(seed), durScale, durShape);
while(vmCount < totalVmNum) {
int vmsInGroup = rVmNum.nextInt(4)+2;
double duration = Math.floor(rDuration.sample());
vmGenerator.generateVMGroup(vmsInGroup, lastStartTime, lastStartTime+duration, null);
lastStartTime += Math.floor(rStartTime.sample());
vmCount += vmsInGroup;
}
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:23,代码来源:VMRequestRandomGenerator.java
示例2: generateVMs
public List<VMSpec> generateVMs(int totalVmNum) {
double lastStartTime = 0;
double startMean = 1800; // sec = 30min
double durScale=14400; // sec = 4 hours
double durShape=1.2;
Random rVmNum = new Random(seed);
ExponentialDistribution rStartTime = new ExponentialDistribution(new Well19937c(seed), startMean, ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
ParetoDistribution rDuration = new ParetoDistribution(new Well19937c(seed), durScale, durShape);
List<VMSpec> vms = new ArrayList<VMSpec>();
while(this.vmId < totalVmNum) {
int vmsInGroup = rVmNum.nextInt(4)+2;
double duration = Math.floor(rDuration.sample());
vms.addAll(generateVMGroup(vmsInGroup, lastStartTime, lastStartTime+duration));
lastStartTime += Math.floor(rStartTime.sample());
}
return vms;
}
示例3: generateVMsRandom
public void generateVMsRandom(int totalVmNum) {
int vmCount = 0;
double lastStartTime = 0;
double startMean = 1800; // sec = 30min
double durScale=14400; // sec = 4 hours
double durShape=1.2;
Random rVmNum = new Random(seed);
ExponentialDistribution rStartTime = new ExponentialDistribution(new Well19937c(seed), startMean, ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
ParetoDistribution rDuration = new ParetoDistribution(new Well19937c(seed), durScale, durShape);
int vmGroup=0;
while(vmCount < totalVmNum) {
int vmsInGroup = rVmNum.nextInt(4)+2;
double duration = Math.floor(rDuration.sample());
vmGenerator.generateVMGroup(vmsInGroup, lastStartTime, lastStartTime+duration, null, vmGroup, -1);
lastStartTime += Math.floor(rStartTime.sample());
vmCount += vmsInGroup;
vmGroup++;
}
}
示例4: computeSCMOSWeights
private static void computeSCMOSWeights(double[] weights, double[] noise)
{
// Per observation read noise.
weights = new double[size * size];
RandomGenerator randomGenerator = new Well19937c(42);
ExponentialDistribution ed = new ExponentialDistribution(randomGenerator, variance,
ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
for (int i = 0; i < weights.length; i++)
{
double pixelVariance = ed.sample();
double pixelGain = Math.max(0.1, gain + randomGenerator.nextGaussian() * gainSD);
// weights = var / g^2
weights[i] = pixelVariance / (pixelGain * pixelGain);
}
// Convert to standard deviation for simulation
noise = new double[weights.length];
for (int i = 0; i < weights.length; i++)
noise[i] = Math.sqrt(weights[i]);
}
示例5: SCMOSLikelihoodWrapperTest
public SCMOSLikelihoodWrapperTest()
{
int n = maxx * maxx;
var = new float[n];
g = new float[n];
o = new float[n];
sd = new float[n];
RandomGenerator rg = new Well19937c(30051977);
PoissonDistribution pd = new PoissonDistribution(rg, O, PoissonDistribution.DEFAULT_EPSILON,
PoissonDistribution.DEFAULT_MAX_ITERATIONS);
ExponentialDistribution ed = new ExponentialDistribution(rg, VAR,
ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
for (int i = 0; i < n; i++)
{
o[i] = (float) pd.sample();
var[i] = (float) ed.sample();
sd[i] = (float) Math.sqrt(var[i]);
g[i] = (float) (G + rg.nextGaussian() * G_SD);
}
}
示例6: setUp
@Setup
public void setUp() {
exponentialDistribution = new ExponentialDistribution(
new ThreadLocalRandomGenerator(),
1.0,
ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}
示例7: filter1IsSameAsFilter2
private void filter1IsSameAsFilter2(GFilter f1, GFilter f2, boolean weighted, double tolerance)
{
Random rand = new Random(-30051976);
float[] data = createData(rand, size, size);
float[] w = null;
if (weighted)
{
ExponentialDistribution ed = new ExponentialDistribution(rand, 57,
ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
w = new float[data.length];
for (int i = 0; i < w.length; i++)
{
w[i] = (float) (1.0 / Math.max(0.01, ed.sample()));
//w[i] = (float) (1.0 / Math.max(0.01, rand.nextGaussian() * 0.2 + 2));
//w[i] = 0.5f;
}
f1.setWeights(w);
f2.setWeights(w);
}
for (double sigma : sigmas)
{
float[] e = data.clone();
f2.run(e, sigma);
float[] o = data.clone();
f1.run(o, sigma);
double max = 0;
for (int i = 0; i < e.length; i++)
{
double d = DoubleEquality.relativeError(e[i], o[i]);
if (max < d)
max = d;
}
System.out.printf("%s vs %s w=%b @ %.1f = %g\n", f1.getName(), f2.getName(), weighted, sigma, max);
Assert.assertTrue(max < tolerance);
}
}
示例8: get
@Override
public Distribution get()
{
return new DistributionOffsetApache(new ExponentialDistribution(new JDKRandomGenerator(), mean, ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY), min, max);
}
示例9: ExponentialNumberGenerator
ExponentialNumberGenerator( RandomDataGenerator random, GENERATE_TYPE mean )
{
this.exponentialDistribution = new ExponentialDistribution( random.getRandomGenerator(), mean.doubleValue(),
ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY );
this.number = NumberHelper.createNumberHelper( mean.getClass() );
}