de.tubs.cs.sc.casim
Class Functions

java.lang.Object
  |
  +--de.tubs.cs.sc.casim.Functions

public final class Functions
extends java.lang.Object

The class Functions provides some predefined functions for use with CAs.


Constructor Summary
Functions()
           
 
Method Summary
static java.lang.String convertFloatString(java.lang.String s)
           
static void doKeepRecord()
          make this multithreaded, create the HashMap.
static double drandom()
           
static boolean prob(double p)
           
static int random(int max)
          random integer value in a given range.
static double randomExponential()
           
static int round(float x)
          round to Integer
static int sign(double x)
           
static int sign(int x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Functions

public Functions()
Method Detail

random

public static final int random(int max)
random integer value in a given range.

Parameters:
max - Upper limit of random values.

prob

public static final boolean prob(double p)
Parameters:
p - the probability
Returns:
true with a probability of p.

randomExponential

public static final double randomExponential()
Returns:
a random number with exponential distribution

drandom

public static final double drandom()
Returns:
a random nnuber betwen 0 and 1

doKeepRecord

public static void doKeepRecord()
make this multithreaded, create the HashMap. This leads to a performance penalty of about a factor of 4.


sign

public static final int sign(double x)
Parameters:
x - any value
Returns:
the sign of x

sign

public static final int sign(int x)
Parameters:
x - any value
Returns:
the sign of x

convertFloatString

public static java.lang.String convertFloatString(java.lang.String s)

round

public static final int round(float x)
round to Integer