|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lenkaspace.creeper.helpers.CRMaths
public class CRMaths
Provides static methods with mathematical functions
| Constructor Summary | |
|---|---|
CRMaths()
|
|
| Method Summary | |
|---|---|
static double |
computeBrokenLine(double middle,
double in)
computeBrokenLine - line with a break middle, x range 0;1 y range -1;1 - an example graph for threshold = 0.2: 1 / / / / 0 / 1 / / / / -1 |
static double |
computeLinearBeforeThreshold(double in,
double threshold)
computeLinearBeforeThreshold - for x=<0;1>, y=<0;1>. |
static double |
computeLinearInverseBeforeThreshold(double in,
double threshold)
computeInverseBeforeThreshold - for x=<0;1>, y=<0;1>. |
static double |
computeLinearNegativeInverseBeforeThreshold(double in,
double threshold)
computeLinearNegativeInverseBeforeThreshold - for x=<0;1>, y=<-1;0>. |
static double |
computeNegativeHillBeforeThreshold(double in,
double threshold)
computeNegativeHillBeforeThreshold - extension of computeLinearNegativeInverseBeforeThreshold, for x=<-1;1>, y=<-1;1> - an example graph for threshold = 0.2: -0.2 0.2 -1 ________ 0 _________ 1 | | | | \ / \ / \ / \ / -1 |
static double |
computeNegativeValleyBeforeThreshold(double in,
double threshold)
computeNegativeValleyBeforeThreshold - extension of computeLinearNegativeInverseBeforeThreshold, for range in = <-1;1> - an example graph for threshold = 0.2: -0.2 0.2 -1 ____0____ 1 | | | | / \ / \ / \ / \ / \ / \ -1 |
static double |
computeSigmoid(double in)
computeSigmoid - returns sigmoid from <0;1> value for x=<0;1> |
static double |
computeSigmoidWithParams(double in,
double slope,
double xAxisThreshold)
computeSigmoid - returns a value from <-1;1> for x=<-1;1> based on two sigmoid with half of the Y range. |
static double |
computeStepFunctionFirstPositive(double in,
double threshold)
computeStepFunctionFirstPositive - for x=<0;1>, y=<-1;1>. |
static double |
computeVShapeImbalanced(double in,
double middle,
double maxLeft,
double maxRight)
computeVshape - returns value from <-1;1> based on a v-shaped graph for x=<0;1> - example: middle = 0.3, maxLeft = 0.4, maxRIght = 0.8 1 / / \ / \ / 0 \ 0.3 / 1 \ / \ / \ / \ / -1 \/ |
static java.lang.String |
formatDouble(double number_,
int numOfdecimalPoints_)
Format a double to return format X.YYYY, where the number of Y's is the number of decimal points |
static double |
getDistanceOfPoints(double x1_,
double y1_,
double x2_,
double y2_)
Get distance between points in a 2D space |
static double |
getRandomDouble(boolean inclZero_)
Return a random double between 0 and 1, including or excluding 0 |
static double |
getRandomGaussian(double mean_,
double variance_)
Return a random Gaussian number |
static int |
getRandomInteger(int start_,
int end_)
Return a random integer between |
static int |
getRandomInteger(int start_,
int end_,
boolean canBePositiveOrNegative_)
Return a random integer between |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CRMaths()
| Method Detail |
|---|
public static double getDistanceOfPoints(double x1_,
double y1_,
double x2_,
double y2_)
public static java.lang.String formatDouble(double number_,
int numOfdecimalPoints_)
number_ - double number to formatnumOfdecimalPoints_ - int number of decimal points
public static double getRandomDouble(boolean inclZero_)
inclZero_ - boolean is true, 0 can also be a result
public static int getRandomInteger(int start_,
int end_)
start_ - int start of the interval, includedend_ - int end of the interval, included
public static int getRandomInteger(int start_,
int end_,
boolean canBePositiveOrNegative_)
start_ - int start of the interval, includedend_ - int end of the interval, includedcanBePositiveOrNegative_ - the function can also return numbers from <-end;-start>
public static double getRandomGaussian(double mean_,
double variance_)
public static double computeBrokenLine(double middle,
double in)
public static double computeVShapeImbalanced(double in,
double middle,
double maxLeft,
double maxRight)
public static double computeSigmoid(double in)
public static double computeSigmoidWithParams(double in,
double slope,
double xAxisThreshold)
public static double computeLinearBeforeThreshold(double in,
double threshold)
public static double computeLinearInverseBeforeThreshold(double in,
double threshold)
public static double computeLinearNegativeInverseBeforeThreshold(double in,
double threshold)
public static double computeNegativeHillBeforeThreshold(double in,
double threshold)
public static double computeNegativeValleyBeforeThreshold(double in,
double threshold)
public static double computeStepFunctionFirstPositive(double in,
double threshold)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||