|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.util.Probs
public final class Probs
Class Probs holds utility methods for working with probabilities.
Field Summary | |
---|---|
(package private) static int |
lastFakeDie
|
private static java.util.logging.Logger |
LOGGER
|
Constructor Summary | |
---|---|
Probs()
|
Method Summary | |
---|---|
static int |
choose(int a,
int b)
Compute a choose b. |
static int |
factorial(int n)
Compute n! |
static double |
meanHits(int dice,
int strikeNumber)
Return the unrounded mean number of hits. |
static int |
modeHits(int dice,
int strikeNumber)
Return the most likely number of hits. |
static double |
probHits(int dice,
int strikeNumber,
int hits)
Return the probability of getting exactly this number of hits. |
static double |
probHitsOrLess(int dice,
int strikeNumber,
int hits)
Return the probability of getting this number of hits or less. |
static double |
probHitsOrMore(int dice,
int strikeNumber,
int hits)
Return the probability of getting this number of hits or more. |
static int |
rollFakeDie()
Return the next die roll in a predictable regular sequence, useful for estimating combat results. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger LOGGER
static int lastFakeDie
Constructor Detail |
---|
public Probs()
Method Detail |
---|
public static int factorial(int n)
public static int choose(int a, int b)
public static double probHits(int dice, int strikeNumber, int hits)
public static double probHitsOrMore(int dice, int strikeNumber, int hits)
public static double probHitsOrLess(int dice, int strikeNumber, int hits)
public static double meanHits(int dice, int strikeNumber)
public static int modeHits(int dice, int strikeNumber)
public static int rollFakeDie()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |