Home News People Research Study Search

Institute for Computing Systems Architecture

Distributions

Download

Description

This is the JDK 1.1-compatible Java package we are currently using when dealing with distributions in our simulation models. However, this package is entirely autonomous and can be used in any project requiring the use of statistical distributions.
This package provides a support for the following discrete distributions:
click to enlarge click to enlarge
Bernoulli's Binomial
click to enlarge click to enlarge click to enlarge
geometric Pascal's Poisson's

and the following continuous distributions:

Examples

The two following examples have the same result. They both print 10 pseudo-randomly selected samples following the Bernoulli distribution with a success probability of 0.7.
// This example use the Bernoulli class, the constructor of which allows to set the parameters.
// The range of these parameters is checked (here 0<prob<1).
// The ParameterException is raised if prob is not valid.
// Once a Bernoulli object has been instanciated,
// the user just needs to call the long sample() method.
// This example, calls the long bernoulli(double prob) method of the Distributions class.
// In that example, the parameters are not checked. An undefined behaviour is obtained when
// defining bad parameters (e.g. a probability must be positive and less than 1.
import eduni.distributions.Bernoulli;

...
Bernoulli source = new Bernoulli(0.7);
for (int i=0; i<10; i++) {
System.out.println("sample "+i+"=" + source.sample());
}
...
import eduni.distributions.Distributions;

...
Distributions source = new Distributions();
for (int i=0; i<10; i++) {
System.out.println("sample "+i+ "=" + source.bernoulli(0.7));
}
...

Acknowledgments

This package was previously designed by Costas Simatos as part of his MSc work. It was a part of Simjava2 but has been revised to be completely autonomous. The revised version is not compatible with Costas'one and should be used in place of it. We aim at providing an efficient simulation core based on Simjava. Then we provide several optional packages which can be used or not depending on your requirements. One of this package eduni.distributions provides a support to deal with continuous and discrete distributions. Other packages will be provided to support entity animation and diagram generation.
The package eduni.distributions can be used with any simulation core including Simjava.


Rainbow separator

HASE Project
Institute for Computing Systems Architecture, School of Informatics, University of Edinburgh


Home : Research : Groups : Hase : Simjava 

Please contact our webadmin with any comments or changes.
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh.