de.tubs.cs.sc.casim
Class FunctionsNS

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

public final class FunctionsNS
extends java.lang.Object

The class FunctionsNS provides some NON-STATIC predefined functions for use with CAs.


Constructor Summary
FunctionsNS()
           
 
Method Summary
static java.lang.String convertFloatString(java.lang.String s)
           
 double drandom()
           
 boolean prob(double p)
           
 int random(int max)
          random integer value in a given range.
 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

FunctionsNS

public FunctionsNS()
Method Detail

random

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

Parameters:
max - Upper limit of random values.

prob

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

randomExponential

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

drandom

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

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