cz.zcu.fav.kiv.jsim
Class JSimSystem

java.lang.Object
  extended by cz.zcu.fav.kiv.jsim.JSimSystem

public class JSimSystem
extends java.lang.Object

The JSimSystem class provides various services, such as random-numbers generation, version functions, etc. All method are static sou you should never need to create an instance of this class.

Since:
J-Sim version 0.0.2
Version:
J-Sim version 0.6.0
Author:
Jarda KAČER

Field Summary
private static java.util.Locale localeInfo
          Locale information about this version of J-Sim.
private static int VERSION_MAJOR
          Major version number of J-Sim.
private static int VERSION_MINOR
          Minor version number of J-Sim.
private static int VERSION_PATCH
          Patch version number of J-Sim.
 
Constructor Summary
JSimSystem()
           
 
Method Summary
static boolean draw(double probability)
          Returns true with a given probability.
static double gauss(double mu, double sigma)
          Returns a random number having Gaussian (normal) distribution with parameters "mu" and "sigma".
static java.lang.String getVersion()
          Returns J-Sim version as string.
static int getVersionMajor()
          Returns the major version number.
static int getVersionMinor()
          Returns the minor version number.
static int getVersionPatch()
          Returns the patch version number.
static void hello()
          Prints out information about J-Sim.
static double negExp(double lambda)
          Returns a random number having exponential distribution with parameter "lambda".
static double uniform(double a, double b)
          Returns a random number having uniform distribution with parameters "a" and "b".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_MAJOR

private static final int VERSION_MAJOR
Major version number of J-Sim.

See Also:
Constant Field Values

VERSION_MINOR

private static final int VERSION_MINOR
Minor version number of J-Sim. This number changes when new features are added to J-Sim.

See Also:
Constant Field Values

VERSION_PATCH

private static final int VERSION_PATCH
Patch version number of J-Sim. This number changes when a bug is patched or a trivial change is made.

See Also:
Constant Field Values

localeInfo

private static final java.util.Locale localeInfo
Locale information about this version of J-Sim. Only US English is supported now.

Constructor Detail

JSimSystem

public JSimSystem()
Method Detail

getVersionMajor

public static int getVersionMajor()
Returns the major version number.

Returns:
The major version number.

getVersionMinor

public static int getVersionMinor()
Returns the minor version number.

Returns:
The minor version number.

getVersionPatch

public static int getVersionPatch()
Returns the patch version number.

Returns:
The patch version number.

getVersion

public static java.lang.String getVersion()
Returns J-Sim version as string.

Returns:
J-Sim version as string.

hello

public static void hello()
Prints out information about J-Sim. The information is printed out to the standard output.


negExp

public static double negExp(double lambda)
Returns a random number having exponential distribution with parameter "lambda". If "lambda" is equal to zero, infinity or NaN can be returned. If it is negative, its absolute value is used instead.

Parameters:
lambda - Parameter "lambda" of the exponential-distribution generator.
Returns:
A random number having exponential distribution with the given parameter "lambda".

uniform

public static double uniform(double a,
                             double b)
Returns a random number having uniform distribution with parameters "a" and "b".

Parameters:
a - The lower bound of the interval <a,b>.
b - The upper bound of the interval <a,b>.
Returns:
A random number having uniform distribution with parameters "a" and "b".

draw

public static boolean draw(double probability)
Returns true with a given probability.

Parameters:
probability - The probability that true will be returned.
Returns:
True if a randomly generated number from <0,1) is less than or equal to the parameter, false otherwise.

gauss

public static double gauss(double mu,
                           double sigma)
Returns a random number having Gaussian (normal) distribution with parameters "mu" and "sigma".

Parameters:
mu - The parameter "mu" (mean value) of the normal-distribution generator.
sigma - The parameter "sigma" (variance) of the normal-distribution generator.
Returns:
A random number having normal distribution with the given parameters "mu" and "sigma".


Copyright © 2000-2006 University of West Bohemia. Licensed under the Academic Free License v. 2.1. Build date 20060812.