当前位置: 首页>>代码示例>>Java>>正文


Java ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY属性代码示例

本文整理汇总了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;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:23,代码来源:VMRequestGenerator.java

示例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++;			
	}
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:24,代码来源:VMRequestRandomGenerator.java

示例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]);
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:19,代码来源:BaseFunctionSolverTest.java

示例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);
	}
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:20,代码来源:SCMOSLikelihoodWrapperTest.java

示例6: setUp

@Setup
public void setUp() {
    exponentialDistribution = new ExponentialDistribution(
            new ThreadLocalRandomGenerator(),
            1.0,
            ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}
 
开发者ID:komiya-atsushi,项目名称:fast-rng-java,代码行数:7,代码来源:ExponentialBenchmark.java

示例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);
	}
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:40,代码来源:GaussianFilterTest.java

示例8: get

@Override
public Distribution get()
{
    return new DistributionOffsetApache(new ExponentialDistribution(new JDKRandomGenerator(), mean, ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY), min, max);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:OptionDistribution.java

示例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() );
}
 
开发者ID:ldbc,项目名称:ldbc_snb_driver,代码行数:6,代码来源:ExponentialNumberGenerator.java


注:本文中的org.apache.commons.math3.distribution.ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。