|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.Chaos
public class Chaos
A source of randomness, anything that depends on quantum physics.
No pseudorandom algorithms. Nothing based on the current time alone because that is predictable,
but based on the difference in time of 2 partially random events is ok.
TODO: Rewrite all the payments to be in units of truly random bits.
For example, a pseudorandom generator that starts with a truly random 64 bit seed
and produces 64000 numbers, may trade 5000 of its numbers for 5 (or less?) truly random numbers.
Their cost would be .001 each. The earlier numbers (after a random seeding) should cost more.
Example: If a slow operation takes an odd or even number of milliseconds, is 1 bit.
Example: Which direction the Human moves the mouse is a few bits.
Example: Every 199th bit from the microphone hole of the computer is random enough.
Should Chaos be an InputStream? Random data comes in asynchronously and unpredictably,
and may be available or not at any one time.
Chaos extends class Liquid because truly random numbers (chaos) should be traded directly
for Liquid type "liquidChaos".
SHOULD ALL FUNCTIONS OF THIS CLASS BE STATIC OR INSTANCE?
GAMBLING SHOULD BE ADDED LATER, BECAUSE IF YOU CAN GAMBLE AND WIN, ITS PROBABLY NOT RANDOM.
Nested Class Summary | |
---|---|
static class |
Chaos.NextFreeChaosInt
canGamble(x,Liquid) for any x > maxPredictBitLength always returns false. |
Field Summary | |
---|---|
static double |
logBase2OfHowManyAtomsInKnownUniverse
|
Method Summary | |
---|---|
static int |
bitsAvailable(double howRandomIsItExponentOf2)
|
static boolean |
buyBoolean(double howRandomIsItExponentOf2,
Liquid payment)
|
static boolean[] |
buyBooleans(int quantity,
double howRandomIsItExponentOf2,
Liquid payment)
|
static boolean[] |
buyBooleans(int quantity,
Liquid payment)
|
static int |
buyInt(double howRandomIsItExponentOf2,
Liquid payment)
|
static int |
buyIntFrom0ToThisMinus1(int quantityPossibleValues,
double howRandomIsItExponentOf2,
Liquid payment)
returns an int between 0 and quantityPossibleValues-1. |
static int |
buySomeBitsOfInt(int howManyBits,
double howRandomIsItExponentOf2,
Liquid payment)
|
static double |
costPerBit(double howRandomIsItExponentOf2)
|
static boolean |
getBoolean(double howRandomIsItExponentOf2)
|
static boolean |
getBoolean(double howRandomIsItExponentOf2,
java.lang.String whyDoYouWantTheBoolean)
same as buyBoolean(Liquid) except asks for the Liquid from class FreeLiquid, but if can not get that Liquid, an Exception is thrown. |
static boolean[] |
getBooleans(int quantity,
double howRandomIsItExponentOf2)
because this depends on FreeLiquid having Liquid type "liquidChaos", it may throw a NeedLiquid |
static boolean[] |
getBooleans(int quantity,
double howRandomIsItExponentOf2,
java.lang.String whyDoYouWantTheBooleans)
|
static int |
getInt(double howRandomIsItExponentOf2)
|
static int |
getInt(double howRandomIsItExponentOf2,
java.lang.String whyDoYouWantTheInt)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double logBase2OfHowManyAtomsInKnownUniverse
Method Detail |
---|
public static double costPerBit(double howRandomIsItExponentOf2)
public static int bitsAvailable(double howRandomIsItExponentOf2)
public static boolean getBoolean(double howRandomIsItExponentOf2) throws NeedLiquid
NeedLiquid
public static boolean getBoolean(double howRandomIsItExponentOf2, java.lang.String whyDoYouWantTheBoolean)
public static boolean buyBoolean(double howRandomIsItExponentOf2, Liquid payment) throws NeedLiquid
NeedLiquid
public static int buyIntFrom0ToThisMinus1(int quantityPossibleValues, double howRandomIsItExponentOf2, Liquid payment)
public static boolean[] buyBooleans(int quantity, Liquid payment) throws NeedLiquid
NeedLiquid
public static int buySomeBitsOfInt(int howManyBits, double howRandomIsItExponentOf2, Liquid payment) throws NeedLiquid
NeedLiquid
public static int buyInt(double howRandomIsItExponentOf2, Liquid payment)
public static int getInt(double howRandomIsItExponentOf2)
public static int getInt(double howRandomIsItExponentOf2, java.lang.String whyDoYouWantTheInt)
public static boolean[] buyBooleans(int quantity, double howRandomIsItExponentOf2, Liquid payment)
public static boolean[] getBooleans(int quantity, double howRandomIsItExponentOf2) throws NeedLiquid
NeedLiquid
public static boolean[] getBooleans(int quantity, double howRandomIsItExponentOf2, java.lang.String whyDoYouWantTheBooleans) throws NeedLiquid
NeedLiquid
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |