|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.MathTools
public class MathTools
Mathematical tools for shaping ranges of values; wrappers beyond @link java.lang.Math. Includes various falvors of random.
| Method Summary | |
|---|---|
static float |
bias(float a,
float b)
push a to 1 extreme or the other, based on b |
static float |
gain(float a,
float b)
push a towards middle (b < .5), or extrema (b > .5). |
static float |
pick(float[][] choices)
|
static float |
pM(float op,
float factor)
plus or minus |
static int |
rand(int max)
|
static float |
randBias(float factor)
|
static float |
randGain(float factor)
|
static float |
random()
|
static float |
random(float max)
|
static int |
random(int max)
|
static java.util.Vector |
randomize(java.util.Vector v)
|
static float |
randPM(float factor)
random plus or minus |
static float |
toExtremes(float x)
|
static boolean |
tossCoin()
heads i win. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static float random()
public static int rand(int max)
public static int random(int max)
public static float random(float max)
public static boolean tossCoin()
public static float pick(float[][] choices)
choices - := array of pairs;
each pair := [value, probability]public static java.util.Vector randomize(java.util.Vector v)
public static float bias(float a,
float b)
a to 1 extreme or the other, based on b
public static float gain(float a,
float b)
public static float randGain(float factor)
public static float randBias(float factor)
public static float pM(float op,
float factor)
op - is 0 to 1public static float randPM(float factor)
factor - the magnitude of the desired result.
public static float toExtremes(float x)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||