|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.Presentable
com.xj.anylogic.engine.Utilities
public abstract class Utilities
This class provides a lot of commonly used functions and constants, including the
probability distributions and mathematical functions. The class is a superclass
for ActiveObject and Experiment, so that its functions can be called without any
prefixing from any code written by the user within those subclasses.
| Field Summary | |
|---|---|
static int |
AM
Value of the getAmPm(Date) method indicating the
period of the day from midnight to just before noon. |
static int |
APRIL
Value of the getMonth(Date) method indicating the
fourth month of the year in the Gregorian and Julian calendars. |
static int |
AUGUST
Value of the getMonth(Date) method indicating the
eighth month of the year in the Gregorian and Julian calendars. |
static int |
DAY
Day time unit |
static int |
DECEMBER
Value of the getMonth(Date) method indicating the
twelfth month of the year in the Gregorian and Julian calendars. |
static int |
FEBRUARY
Value of the getMonth(Date) method indicating the
second month of the year in the Gregorian and Julian calendars. |
static int |
FRIDAY
Value of the getDayOfWeek(Date) method indicating
Friday. |
static int |
HOUR
Hour time unit |
static double |
infinity
A constant holding the positive infinity of type double. |
static int |
JANUARY
Value of the getMonth(Date) method indicating the
first month of the year in the Gregorian and Julian calendars. |
static int |
JULY
Value of the getMonth(Date) method indicating the
seventh month of the year in the Gregorian and Julian calendars. |
static int |
JUNE
Value of the getMonth(Date) method indicating the
sixth month of the year in the Gregorian and Julian calendars. |
static int |
MARCH
Value of the getMonth(Date) method indicating the
third month of the year in the Gregorian and Julian calendars. |
static int |
MAY
Value of the getMonth(Date) method indicating the
fifth month of the year in the Gregorian and Julian calendars. |
static int |
MILLISECOND
Millisecond time unit |
static int |
MINUTE
Minute time unit |
static int |
MONDAY
Value of the getDayOfWeek(Date) method indicating
Monday. |
static int |
MONTH
Month time unit |
static int |
NOVEMBER
Value of the getMonth(Date) method indicating the
eleventh month of the year in the Gregorian and Julian calendars. |
static int |
OCTOBER
Value of the getMonth(Date) method indicating the
tenth month of the year in the Gregorian and Julian calendars. |
static int |
PM
Value of the getAmPm(Date) method indicating the period
of the day from noon to just before midnight. |
static int |
SATURDAY
Value of the getDayOfWeek(Date) method indicating
Saturday. |
static int |
SECOND
Second time unit |
static int |
SEPTEMBER
Value of the getMonth(Date) method indicating the
ninth month of the year in the Gregorian and Julian calendars. |
static int |
SUNDAY
Value of the getDayOfWeek(Date) method indicating
Sunday. |
static int |
THURSDAY
Value of the getDayOfWeek(Date) method indicating
Thursday. |
static long |
TIME_UNIT_DAY
One of the possible time units. |
static long |
TIME_UNIT_HOUR
One of the possible time units. |
static long |
TIME_UNIT_MILLISECOND
One of the possible time units. |
static long |
TIME_UNIT_MINUTE
One of the possible time units. |
static long |
TIME_UNIT_SECOND
One of the possible time units. |
static long |
TIME_UNIT_WEEK
One of the possible time units. |
static int |
TUESDAY
Value of the getDayOfWeek(Date) method indicating
Tuesday. |
static int |
UNDECIMBER
Value of the getMonth(Date) method indicating the
thirteenth month of the year. |
static int |
WEDNESDAY
Value of the getDayOfWeek(Date) method indicating
Wednesday. |
static int |
WEEK
Week time unit |
static int |
YEAR
Year time unit |
| Constructor Summary | |
|---|---|
Utilities()
|
|
| Method Summary | ||
|---|---|---|
int |
bernoulli(double p)
Generates a sample of the Bernoulli distribution, i.e. 1 with probability p and 0 with probability 1 - p. |
|
static int |
bernoulli(double p,
java.util.Random r)
Generates a sample of the Bernoulli distribution using the specified random number generator. |
|
double |
beta(double p,
double q)
Generates a sample of the Beta distribution with min
set to 0 and max set to 1. |
|
double |
beta(double p,
double q,
double min,
double max)
Generates a sample of the Beta distribution. |
|
double |
beta(double min,
double max,
double p,
double q,
double shift,
double stretch)
Generates a sample of truncated Beta distribution. |
|
static double |
beta(double min,
double max,
double p,
double q,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Beta distribution using the specified random number generator. |
|
static double |
beta(double p,
double q,
double min,
double max,
java.util.Random r)
Generates a sample of the Beta distribution using the specified random number generator. |
|
int |
binomial(double p)
Generates a sample of the Binomial distribution with n set
to 1. |
|
double |
binomial(double min,
double max,
double p,
double n,
double shift,
double stretch)
Generates a sample of truncated Binomial distribution. |
|
static double |
binomial(double min,
double max,
double p,
double n,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Binomial distribution using the specified random number generator. |
|
int |
binomial(double p,
int n)
Generates a sample of the Binomial distribution. |
|
static int |
binomial(double p,
int n,
java.util.Random r)
Generates a sample of the Binomial distribution using the specified random number generator. |
|
static java.lang.String |
briefInfoOn(java.lang.Object object)
Returns a brief one-line textual information on the given object. |
|
double |
cauchy(double lambda)
Generates a sample of the Cauchy distribution with theta
set to 0. |
|
double |
cauchy(double lambda,
double theta)
Generates a sample of the Cauchy distribution. |
|
static double |
cauchy(double lambda,
double theta,
java.util.Random r)
Generates a sample of the Cauchy distribution using the specified random number generator. |
|
double |
chi2(double nu)
Generates a sample of the Chi Squared distribution with min
set to 0. |
|
double |
chi2(double nu,
double min)
Generates a sample of the Chi Squared distribution. |
|
static double |
chi2(double nu,
double min,
java.util.Random r)
Generates a sample of the Chi Squared distribution using the specified random number generator. |
|
static void |
copyToClipboard(java.lang.String s)
Puts the given text on the system clipboard Note that this method may not work when the model is started as applet due to security policy of browser |
|
static java.net.URL |
createURL_xjal(java.lang.String url)
Creates an URL object from the String representation |
|
java.util.Date |
date()
Returns the current model date with respect to the start time/date and the model time unit. |
|
double |
dateToTime(java.util.Date d)
Converts the given date to model time with respect to the start date, start time and model time unit settings |
|
double |
day()
Returns a time value equal to one day according to the current time unit setting. |
|
static double |
difference(DataSet ds1,
DataSet ds2)
Difference function which is always not-negative and reflects difference between 2 given data sets in their common arguments range |
|
static double |
difference(DataSet ds,
TableFunction f)
Difference function which is always not-negative and reflects difference between given data set and table function in their common arguments range |
|
static double |
differenceInDateUnits(int timeUnit,
java.util.Date date1,
java.util.Date date2)
Returns the difference (date2 - date1)
between two dates in the given time units. |
|
double |
differenceInDateUnits(int timeUnit,
double time1,
double time2)
Returns the difference (time2 - time1)
between two model dates (corresponding to the given model times)
in the given time units. |
|
static java.util.Date |
dropTime(java.util.Date date)
This utility method drops time-of-the-day information and returns the date with the time 00:00:00.000 |
|
double |
erlang(double beta,
int m)
Generates a sample of the Erlang distribution with min
set to 0. |
|
double |
erlang(double beta,
int m,
double min)
Generates a sample of the Erlang distribution. |
|
static double |
erlang(double beta,
int m,
double min,
java.util.Random r)
Generates a sample of the Erlang distribution using the specified random number generator. |
|
abstract java.lang.RuntimeException |
error(java.lang.String errorText)
Signals an error during the model run by throwing a RuntimeException with errorText preceded by the active object full name. |
|
java.lang.RuntimeException |
error(java.lang.String errorTextFormat,
java.lang.Object... args)
The same as error(String) but allows error format syntax like
in String.format(String, Object...) method |
|
double |
exponential()
Generates a sample of the Exponential distribution with lambda set to 1 and min set to
0. |
|
double |
exponential(double lambda)
Generates a sample of the Exponential distribution with min set to 0. |
|
double |
exponential(double lambda,
double min)
Generates a sample of the Exponential distribution. |
|
double |
exponential(double min,
double max,
double shift,
double stretch)
Generates a sample of truncated Exponential distribution. |
|
static double |
exponential(double min,
double max,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Exponential distribution using the specified random number generator. |
|
static double |
exponential(double lambda,
double min,
java.util.Random r)
Generates a sample of the Exponential distribution using the specified random number generator. |
|
static java.lang.String |
format(boolean value)
Formats a boolean value |
|
static java.lang.String |
format(char value)
Formats a character to String |
|
static java.lang.String |
format(java.util.Date date)
Formats a date using the default AnyLogic formatter |
|
static java.lang.String |
format(double value)
Formats a double value using the default AnyLogic formatter |
|
static java.lang.String |
format(int value)
Formats an integer value using the default AnyLogic formatter |
|
static java.lang.String |
format(long value)
Formats a long value using the default AnyLogic formatter |
|
static java.lang.String |
formatDayOfWeek(int dayOfWeek,
boolean fullName)
Returns the full or short name of the weekday |
|
static java.lang.String |
formatGeoHeading(double radians)
Formats given heading angle (measured in radians CW, starting from North direction) as human-readable geographical heading (azimuth). |
|
static java.lang.String |
formatLatitude(double degrees)
Formats latitude |
|
static java.lang.String |
formatLongitude(double degrees)
Formats longitude |
|
static java.lang.String |
formatMonth(int month,
boolean fullName)
Returns the full or short name of the month |
|
java.lang.String |
formatTimeInterval(double dt)
Returns a string representation of a given time interval, according to the current time unit settings, in the form 123 days 21h 0'56". |
|
static double |
gamma_frac(double a,
java.util.Random r)
|
|
double |
gamma(double alpha,
double beta)
Generates a sample of the Gamma distribution with min set
to 0. |
|
double |
gamma(double alpha,
double beta,
double min)
Generates a sample of the Gamma distribution. |
|
double |
gamma(double min,
double max,
double alpha,
double shift,
double stretch)
Generates a sample of truncated Gamma distribution. |
|
static double |
gamma(double min,
double max,
double alpha,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Gamma distribution using the specified random number generator. |
|
static double |
gamma(double alpha,
double beta,
double min,
java.util.Random r)
Generates a sample of the Gamma distribution using the specified random number generator. |
|
static double |
gammaLog(double x)
Returns the natural logarithm of the gamma function of x:ln(Γ(x)). |
|
int |
geometric(double p)
Generates a sample of the Geometric distribution. |
|
static int |
geometric(double p,
java.util.Random r)
Generates a sample of the Geometric distribution using the specified random number generator. |
|
int |
getAmPm()
Indicates whether the hour of the current model date with respect to the start time/date and the model time unit is before ( )
or after () noon. |
|
static int |
getAmPm(java.util.Date date)
Indicates whether the hour of the given date is before ()
or after () noon. |
|
int |
getDayOfMonth()
Returns the day of the month of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getDayOfMonth(java.util.Date date)
Returns the day of the month of the given date. |
|
int |
getDayOfWeek()
Returns the day of the week of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getDayOfWeek(java.util.Date date)
Returns the day of the week of the given date. |
|
static int |
getDayOfYear(java.util.Date date)
Returns the day of the year of the given date. |
|
java.util.Random |
getDefaultRandomGenerator()
Retrieves the random number generator used by all probability distributions by default, i.e. if no particular generator is specified in the call to a probability distribution function. |
|
static double |
getDistance(double x1,
double y1,
double x2,
double y2)
Returns the distance between two given points (x1, y1) and (x2, y2) |
|
static double |
getDistance(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the distance between two given points (x1, y1, z1) and (x2, y2, z2) |
|
static double |
getDistanceFromPointToLine(double x1,
double y1,
double x2,
double y2,
double px,
double py)
Returns the distance from a point to a line. |
|
static double |
getDistanceFromPointToLineSq(double x1,
double y1,
double x2,
double y2,
double px,
double py)
Returns the square of the distance from a point to a line. |
|
static double |
getDistanceFromPointToSegment(double x1,
double y1,
double x2,
double y2,
double px,
double py)
Returns the distance from a point to a line segment. |
|
static double |
getDistanceFromPointToSegmentSq(double x1,
double y1,
double x2,
double y2,
double px,
double py)
Returns the square of the distance from a point to a line segment. |
|
static double |
getDistanceSq(double x1,
double y1,
double x2,
double y2)
Returns the square of the distance between two given points (x1, y1) and (x2, y2). |
|
static double |
getDistanceSq(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Returns the square of the distance between two given points (x1, y1, z1) and (x2, y2, z2). |
|
int |
getHour()
Returns the hour of the morning or afternoon of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getHour(java.util.Date date)
Returns the hour of the morning or afternoon of the given date. |
|
int |
getHourOfDay()
Returns the hour of day of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getHourOfDay(java.util.Date date)
Returns the hour of day of the given date. |
|
static double |
getLength(double dx,
double dy)
Returns the length of the vector (dx, dy) |
|
static double |
getLength(double dx,
double dy,
double dz)
Returns the length of the vector (dx, dy, dz) |
|
int |
getMillisecond()
Returns the millisecond within the second of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getMillisecond(java.util.Date date)
Returns the millisecond within the second of the given date. |
|
int |
getMinute()
Returns the minute within the hour of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getMinute(java.util.Date date)
Returns the minute within the hour of the given date. |
|
int |
getMonth()
Returns the month of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getMonth(java.util.Date date)
Returns the month of the given date. |
|
|
getRandom(java.util.Collection<T> collection)
Returns the randomly chosen element of the given collection. |
|
static
|
getRandom(java.util.Collection<T> collection,
java.util.Random r)
Returns the randomly chosen element of the given collection. |
|
int |
getSecond()
Returns the second within the minute of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getSecond(java.util.Date date)
Returns the second within the minute of the given date. |
|
double |
getTime()
Deprecated. Use time() instead |
|
int |
getYear()
Returns the year of the current model date with respect to the start time/date and the model time unit. |
|
static int |
getYear(java.util.Date date)
Returns the year of the given date. |
|
double |
gumbel1(double a,
double b)
Generates a sample of the Type I Gumbel distribution. |
|
static double |
gumbel1(double a,
double b,
java.util.Random r)
Generates a sample of the Type I Gumbel distribution using the specified random number generator. |
|
double |
gumbel2(double a,
double b)
Generates a sample of the Type II Gumbel distribution. |
|
static double |
gumbel2(double a,
double b,
java.util.Random r)
Generates a sample of the Type II Gumbel distribution using the specified random number generator. |
|
double |
hour()
Returns a time value equal to one hour according to the current time unit setting. |
|
int |
hypergeometric(int ss,
int dn,
int ps)
Generates a sample of the Hypergeometric distribution. |
|
static int |
hypergeometric(int ss,
int dn,
int ps,
java.util.Random r)
Generates a sample of the Hypergeometric distribution using the specified random number generator. |
|
static java.lang.String |
inspectOf(java.lang.Object object)
Returns a textual info on the object that can be displayed in the multi-line Inspect window. |
|
static boolean |
isLineIntersectingLine(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4)
Tests if the line segment from (x1,y1) to (x2,y2)
intersects the line segment from (x3,y3) to (x4,y4). |
|
static boolean |
isLineIntersectingRectangle(double x1,
double y1,
double x2,
double y2,
double rx,
double ry,
double rw,
double rh)
Check if the line intersects the given rectangle |
|
static boolean |
isPointInsideRectangle(double rx,
double ry,
double rw,
double rh,
double px,
double py)
Tests if the specified point is inside the given rectangle. |
|
static boolean |
isPointOnTheSameLine(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Tests if the three point lie on the same line |
|
double |
laplace(double phi,
double theta)
Generates a sample of the Laplace distribution. |
|
static double |
laplace(double phi,
double theta,
java.util.Random r)
Generates a sample of the Laplace distribution using the specified random number generator. |
|
static double |
limit(double min,
double x,
double max)
Returns x if it is within [min,max] interval, otherwise returns the closest bound. |
|
static double |
limitMax(double x,
double max)
Returns x if it is less or equal to max, otherwise returns max. |
|
static double |
limitMin(double min,
double x)
Returns x if it is greater or equal to min, otherwise returns min. |
|
int |
logarithmic(double theta)
Generates a sample of the Logarithmic distribution. |
|
static int |
logarithmic(double theta,
java.util.Random r)
Generates a sample of the Logarithmic distribution using the specified random number generator. |
|
double |
logistic(double beta,
double alpha)
Generates a sample of the Logistic distribution. |
|
static double |
logistic(double beta,
double alpha,
java.util.Random r)
Generates a sample of the Logistic distribution using the specified random number generator. |
|
double |
lognormal(double mu,
double sigma,
double min)
Generates a sample of the Lognormal distribution. |
|
static double |
lognormal(double mu,
double sigma,
double min,
java.util.Random r)
Generates a sample of the Lognormal distribution using the specified random number generator. |
|
double |
millisecond()
Returns a time value equal to one millisecond according to the current time unit setting. |
|
double |
minute()
Returns a time value equal to one minute according to the current time unit setting. |
|
int |
negativeBinomial(double p,
double n)
Generates a sample of the Negative Binomial distribution. |
|
double |
negativeBinomial(double min,
double max,
double p,
double n,
double shift,
double stretch)
Generates a sample of truncated Negative Binomial distribution. |
|
static double |
negativeBinomial(double min,
double max,
double p,
double n,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Negative Binomial distribution using the specified random number generator. |
|
static int |
negativeBinomial(double p,
double n,
java.util.Random r)
Generates a sample of the Negative Binomial distribution using the specified random number generator. |
|
double |
normal()
Generates a sample of the Normal distribution with mean set
to 0 and sigma set to 1. |
|
double |
normal(double sigma)
Generates a sample of the Normal distribution with mean set
to 0. |
|
double |
normal(double sigma,
double mean)
Generates a sample of the Normal distribution. |
|
double |
normal(double min,
double max,
double shift,
double stretch)
Generates a sample of truncated Normal distribution. |
|
static double |
normal(double min,
double max,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Normal distribution using the specified random number generator. |
|
static double |
normal(double sigma,
double mean,
java.util.Random r)
Generates a sample of the Normal distribution using the specified random number generator. |
|
double |
pareto(double alpha)
Generates a sample of the Pareto distribution with min set
to 1. |
|
double |
pareto(double alpha,
double min)
Generates a sample of the Pareto distribution. |
|
static double |
pareto(double alpha,
double min,
java.util.Random r)
Generates a sample of the Pareto distribution using the specified random number generator. |
|
double |
pert(double min,
double max,
double mode)
Generates a sample of the PERT distribution. |
|
static double |
pert(double min,
double max,
double mode,
java.util.Random r)
Generates a sample of the PERT distribution using the specified random number generator. |
|
int |
poisson(double lambda)
Generates a sample of the Poisson distribution. |
|
double |
poisson(double min,
double max,
double mean,
double shift,
double stretch)
Generates a sample of truncated Poisson distribution. |
|
static double |
poisson(double min,
double max,
double mean,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Poisson distribution using the specified random number generator. |
|
static int |
poisson(double lambda,
java.util.Random r)
Generates a sample of the Poisson distribution using the specified random number generator. |
|
static void |
prepareBeforeExperimentStart_xjal(java.lang.Class<?> experimentClass)
This method is internal and isn't intended to be called by user (may be removed in future releases) |
|
double |
pulse(double startTime,
double pulseWidth)
Returns 1, starting at startTime, and lasting
for interval pulseWidth; 0 is returned at all other times. |
|
double |
pulseTrain(double startTime,
double pulseWidth,
double timeBetweenPulses,
double endTime)
Returns 1, starting at startTime, and lasting for
interval pulseWidth and then repeats this pattern every
timeBetweenPulses time until endTime;
0 is returned at all other times. |
|
static double |
quantum(double value,
double quantizer)
Returns the number smaller (by absolute value) than or equal to value that is an
integer multiple of quantizer. |
|
double |
ramp(double slope,
double startTime,
double endTime)
Returns 0 until the startTime and then slopes upward
until endTime and then holds constant. |
|
boolean |
randomFalse(double p)
Generates false with the given probability p. |
|
static boolean |
randomFalse(double p,
java.util.Random r)
Generates false with the given probability p
using the specified random number generator. |
|
boolean |
randomTrue(double p)
Generates true with the given probability p. |
|
static boolean |
randomTrue(double p,
java.util.Random r)
Generates true with the given probability p
using the specified random number generator. |
|
double |
rayleigh(double sigma)
Generates a sample of the Rayleigh distribution with min
set to 0. |
|
double |
rayleigh(double sigma,
double min)
Generates a sample of the Rayleigh distribution. |
|
static double |
rayleigh(double sigma,
double min,
java.util.Random r)
Generates a sample of the Rayleigh distribution using the specified random number generator. |
|
double |
second()
Returns a time value equal to one second according to the current time unit setting. |
|
void |
setDefaultRandomGenerator(java.util.Random r)
Sets the random number generator used by all probability distributions by default, i.e. if no particular generator is specified in the call to a probability distribution function. |
|
static double |
sqr(double v)
Returns the square of the given value ( v2) |
|
double |
step(double height,
double stepTime)
Returns 0 until the stepTime and then returns height |
|
double |
time()
Returns the current model (logical) time. |
|
java.util.Date |
timeToDate(double t)
Converts the given model time to date with respect to the start date, start time and model time unit settings, null if the time is infinity. |
|
static java.util.Date |
toDate(int year,
int month,
int day,
int hourOfDay,
int minute,
int second)
Returns the date in the default time zone with given field values. |
|
static long |
toDateInMillis(int year,
int month,
int day,
int hourOfDay,
int minute,
int second)
Same as toDate(int, int, int, int, int, int) but returns the date
in its milliseconds representation (see Date.getTime()), i.e. |
|
static double |
toLatitude(int degrees,
int minutes,
double seconds,
boolean northOrSouth)
Converts latitude from human-readable format (e.g. 59° 56' 0" North) to format used in the model |
|
static double |
toLongitude(int degrees,
int minutes,
double seconds,
boolean eastOrWest)
Converts longitude from human-readable format (e.g. 30° 20' 0" East) to format used in the model |
|
double |
toTimeout(int timeUnit,
double amount)
Returns timeout, in model time units, which equals to the given amount
of timeUnits from current model datee.g. |
|
static void |
trace(java.lang.Object o)
Prints a string representation of an object to the standard output stream. |
|
static void |
traceln()
Prints a line delimiter to the standard output stream. |
|
static void |
traceln(java.lang.Object o)
Prints a string representation of an object with a line delimiter at the end to the standard output stream. |
|
static void |
traceln(java.lang.String textFormat,
java.lang.Object... args)
The same as traceln(Object) but allows text format syntax like
in String.format(String, Object...) method |
|
double |
triangular(double min,
double max)
Generates a sample of the Triangular distribution with mode set to (min + max)/2. |
|
double |
triangular(double min,
double max,
double mode)
Generates a sample of the Triangular distribution. |
|
double |
triangular(double min,
double max,
double left,
double mode,
double right)
Generates a sample of truncated Triangular distribution. |
|
static double |
triangular(double min,
double max,
double left,
double mode,
double right,
java.util.Random r)
Generates a sample of truncated Triangular distribution using the specified random number generator. |
|
static double |
triangular(double min,
double max,
double mode,
java.util.Random r)
Generates a sample of the Triangular distribution using the specified random number generator. |
|
int |
uniform_discr(int max)
Generates a sample of the Discrete Uniform distribution in the interval [0, max], both 0 and max included! |
|
int |
uniform_discr(int min,
int max)
Generates a sample of the Discrete Uniform distribution on the interval [min, max], both min and max included! |
|
static int |
uniform_discr(int min,
int max,
java.util.Random r)
Generates a sample of the Discrete Uniform distribution on the interval [min, max] using the specified random number generator, both 0 and max included! |
|
double |
uniform_pos()
Generates a positive random value uniformly distributed on the interval (0,1). |
|
static double |
uniform_pos(java.util.Random r)
Generates a positive random value uniformly distributed on the interval (0,1), using the specified random number generator. |
|
double |
uniform()
Generates a random value uniformly distributed on the interval [0,1), the upper bound is not included. |
|
double |
uniform(double max)
Generates a sample of the Uniform distribution on the interval [0, max). |
|
double |
uniform(double min,
double max)
Generates a sample of the Uniform distribution on the interval [min, max). |
|
static double |
uniform(double min,
double max,
java.util.Random r)
Generates a sample of the Uniform distribution on the interval [min, max) using the specified random number generator. |
|
static double |
uniform(java.util.Random r)
Generates a random value uniformly distributed on the interval [0,1), using the specified random number generator. |
|
double |
week()
Returns a time value equal to one week according to the current time unit setting. |
|
double |
weibull(double beta,
double alpha)
Generates a sample of the Weibull distribution with min set to 0. |
|
double |
weibull(double alpha,
double beta,
double min)
Generates a sample of the Weibull distribution. |
|
double |
weibull(double min,
double max,
double alpha,
double shift,
double stretch)
Generates a sample of truncated Weibull distribution. |
|
static double |
weibull(double min,
double max,
double alpha,
double shift,
double stretch,
java.util.Random r)
Generates a sample of truncated Weibull distribution using the specified random number generator. |
|
static double |
weibull(double alpha,
double beta,
double min,
java.util.Random r)
Generates a sample of the Weibull distribution using the specified random number generator. |
|
static double |
xidz(double a,
double b,
double x)
Tries to divide the first argument by the second. |
|
static double |
zidz(double a,
double b)
Tries to divide the first argument by the second. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SUNDAY
getDayOfWeek(Date) method indicating
Sunday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int MONDAY
getDayOfWeek(Date) method indicating
Monday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int TUESDAY
getDayOfWeek(Date) method indicating
Tuesday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int WEDNESDAY
getDayOfWeek(Date) method indicating
Wednesday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int THURSDAY
getDayOfWeek(Date) method indicating
Thursday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int FRIDAY
getDayOfWeek(Date) method indicating
Friday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int SATURDAY
getDayOfWeek(Date) method indicating
Saturday.
getDayOfWeek(Date),
getDayOfWeek(),
Engine.getDayOfWeek(),
Constant Field Valuespublic static final int JANUARY
getMonth(Date) method indicating the
first month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int FEBRUARY
getMonth(Date) method indicating the
second month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int MARCH
getMonth(Date) method indicating the
third month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int APRIL
getMonth(Date) method indicating the
fourth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int MAY
getMonth(Date) method indicating the
fifth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int JUNE
getMonth(Date) method indicating the
sixth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int JULY
getMonth(Date) method indicating the
seventh month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int AUGUST
getMonth(Date) method indicating the
eighth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int SEPTEMBER
getMonth(Date) method indicating the
ninth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int OCTOBER
getMonth(Date) method indicating the
tenth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int NOVEMBER
getMonth(Date) method indicating the
eleventh month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int DECEMBER
getMonth(Date) method indicating the
twelfth month of the year in the Gregorian and Julian calendars.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int UNDECIMBER
getMonth(Date) method indicating the
thirteenth month of the year. Although GregorianCalendar
does not use this value, lunar calendars do.
getMonth(Date),
getMonth(),
Engine.getMonth(),
Constant Field Valuespublic static final int AM
getAmPm(Date) method indicating the
period of the day from midnight to just before noon.
getAmPm(Date),
getAmPm(),
Engine.getAmPm(),
Constant Field Valuespublic static final int PM
getAmPm(Date) method indicating the period
of the day from noon to just before midnight.
getAmPm(Date),
getAmPm(),
Engine.getAmPm(),
Constant Field Valuespublic static final int YEAR
toTimeout(int, double),
Constant Field Valuespublic static final int MONTH
toTimeout(int, double),
Constant Field Valuespublic static final int WEEK
toTimeout(int, double),
Constant Field Valuespublic static final int DAY
toTimeout(int, double),
Constant Field Valuespublic static final int HOUR
toTimeout(int, double),
Constant Field Valuespublic static final int MINUTE
toTimeout(int, double),
Constant Field Valuespublic static final int SECOND
toTimeout(int, double),
Constant Field Valuespublic static final int MILLISECOND
toTimeout(int, double),
Constant Field Valuespublic static final double infinity
double.-infinity
public static final long TIME_UNIT_MILLISECOND
public static final long TIME_UNIT_SECOND
public static final long TIME_UNIT_MINUTE
public static final long TIME_UNIT_HOUR
public static final long TIME_UNIT_DAY
public static final long TIME_UNIT_WEEK
| Constructor Detail |
|---|
public Utilities()
| Method Detail |
|---|
public abstract java.lang.RuntimeException error(java.lang.String errorText)
errorText - the text describing the error that will be displayed.
throw error("my message");
public java.lang.RuntimeException error(java.lang.String errorTextFormat,
java.lang.Object... args)
error(String) but allows error format syntax like
in String.format(String, Object...) method
error(String),
String.format(String, Object...)public double time()
@Deprecated public double getTime()
time() instead
public java.util.Date date()
public java.util.Date timeToDate(double t)
t - the model time
public double dateToTime(java.util.Date d)
d - the date to convert
public static int getMillisecond(java.util.Date date)
date.
date - the date for which millisecond is returned
datepublic static int getSecond(java.util.Date date)
date.
date - the date for which second is returned
datepublic static int getMinute(java.util.Date date)
date.
date - the date for which minute is returned
datepublic static int getHour(java.util.Date date)
date.
date - the date for which hour is returned
dategetAmPm(Date),
getHourOfDay(Date)public static int getAmPm(java.util.Date date)
date is before (AM)
or after (PM) noon.PM.
date - the date for AM/PM information is returned
AM or PM depending on the hour of
the given dategetHour(Date),
getHourOfDay(Date)public static int getHourOfDay(java.util.Date date)
date.
date - the date for which hour of day is returned
dategetHour(Date),
getAmPm(Date)public static int getDayOfWeek(java.util.Date date)
date.
date - the date for which day of the week is returned
datepublic static int getDayOfMonth(java.util.Date date)
date.
date - the date for which day of the month is returned
datepublic static int getDayOfYear(java.util.Date date)
date.
date - the date for which day of the year is returned
datepublic static int getMonth(java.util.Date date)
date.JANUARY which is 0; the last depends on the number of
months in a year.JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
UNDECIMBER (indicates the
thirteenth month of the year. Although GregorianCalendar
does not use this value, lunar calendars do)
date - the date for which month is returned
datepublic static int getYear(java.util.Date date)
date.
date - the date for which year is returned
datepublic int getMillisecond()
public int getSecond()
public int getMinute()
public int getHour()
getAmPm(Date),
getHourOfDay(Date)public int getAmPm()
AM)
or after (PM) noon.PM.
AM or PM depending on the hour of
the current model date with respect to the start time/date and the model time unitgetHour(Date),
getHourOfDay(Date)public int getHourOfDay()
getHour(Date),
getAmPm(Date)public int getDayOfWeek()
public int getDayOfMonth()
public int getMonth()
JANUARY which is 0; the last depends on the number of
months in a year.JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
UNDECIMBER (indicates the
thirteenth month of the year. Although GregorianCalendar
does not use this value, lunar calendars do)
public int getYear()
public double toTimeout(int timeUnit,
double amount)
amount
of timeUnits from current model datetoTimeout( DAY, 1 ) returns timeout in model time units from
date() to the ( date() + 1 day )day()
which will always return timeout for 24 hours and may result in events
scheduled at 7:00 or 9:00
timeUnit - time unit, possible values:amount - the number of time units (may be negative -
in this case result will be also negative)
amount of timeUnits
public static double differenceInDateUnits(int timeUnit,
java.util.Date date1,
java.util.Date date2)
(date2 - date1)
between two dates in the given time units.date1
to obtain date2
public double differenceInDateUnits(int timeUnit,
double time1,
double time2)
(time2 - time1)
between two model dates (corresponding to the given model times)
in the given time units.time1 to obtain time2
public static java.util.Date dropTime(java.util.Date date)
date with the time 00:00:00.000
date - the date
date with the time 00:00:00.000public static void trace(java.lang.Object o)
o - the object to printpublic static void traceln(java.lang.Object o)
o - the object to printpublic static void traceln()
public static void traceln(java.lang.String textFormat,
java.lang.Object... args)
traceln(Object) but allows text format syntax like
in String.format(String, Object...) method
traceln(Object),
String.format(String, Object...)public void setDefaultRandomGenerator(java.util.Random r)
Random.nextDouble() and
Random.nextGaussian() methods of the specified random
number generator are called.
r - new random number generator.getDefaultRandomGenerator()public java.util.Random getDefaultRandomGenerator()
setDefaultRandomGenerator(java.util.Random)public double uniform()
public static double uniform(java.util.Random r)
r - the random number generator.
public double uniform_pos()
public static double uniform_pos(java.util.Random r)
r - the random number generator.
public double uniform(double max)
uniform(0, max).
For more details see uniform(double,double).
max - the maximum x value.
public double uniform(double min,
double max)
min - the minimum x value.max - the maximum x value.
public static double uniform(double min,
double max,
java.util.Random r)
uniform(double,double).
min - the minimum x value.max - the maximum x value.r - the random number generator.
public int uniform_discr(int max)
uniform_discr(0, max).
For more details see uniform_discr(int,int).
max - the maximum x value.
public int uniform_discr(int min,
int max)
min - the minimum x value.max - the maximum x value.
public static int uniform_discr(int min,
int max,
java.util.Random r)
uniform_discr(int,int).
min - the minimum x value.max - the maximum x value.r - the random number generator.
public boolean randomTrue(double p)
true with the given probability p.
Is equivalent to uniform() < p.
The probability of false is 1 - p
correspondingly.
p - the probability of true.
true with probability p,
false with probability 1 - p.randomFalse(double),
bernoulli(double)
public static boolean randomTrue(double p,
java.util.Random r)
true with the given probability p
using the specified random number generator.randomTrue(double)
p - the probability of true.r - the random number generator.
true with probability p,
false with probability 1 - p.randomFalse(double, Random),
bernoulli(double, Random)public boolean randomFalse(double p)
false with the given probability p.
Is equivalent to uniform() >= p.
The probability of true is 1 - p
correspondingly.
p - the probability of false.
false with probability p,
true with probability 1 - prandomTrue(double),
bernoulli(double)
public static boolean randomFalse(double p,
java.util.Random r)
false with the given probability p
using the specified random number generator.randomFalse(double)
p - the probability of false.r - the random number generator.
false with probability p,
true with probability 1 - prandomTrue(double, Random),
bernoulli(double, Random)public <T> T getRandom(java.util.Collection<T> collection)
null.collection.get( uniform_discr( collection.size() - 1 ) )
collection - the collection to select an element from
null,
if collection is empty
public static <T> T getRandom(java.util.Collection<T> collection,
java.util.Random r)
getRandom(Collection)
collection - the collection to select an element fromr - the random number generator.
null,
if collection is emptypublic int bernoulli(double p)
p and 0 with probability 1 - p.
p - the probability of 1.
public static int bernoulli(double p,
java.util.Random r)
bernoulli(double).
p - the probability of 1.r - the random number generator.
public double beta(double p,
double q)
min
set to 0 and max set to 1.
Is equivalent to beta(p, q, 0, 1).
For more details see beta(double,double,double,double).
p - the lower shape parameter > 0.q - the upper shape parameter > 0.
public double beta(double p,
double q,
double min,
double max)
p - the lower shape parameter > 0.q - the upper shape parameter > 0.min - the minimum x value.max - the maximum x value.
public double beta(double min,
double max,
double p,
double q,
double shift,
double stretch)
beta(p, q, 0, 1) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.beta(double, double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the lower shape parameter > 0. Also known as alpha parameterq - the upper shape parameter > 0. Also known as beta parametershift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static double beta(double p,
double q,
double min,
double max,
java.util.Random r)
beta(double,double,double,double).
p - the lower shape parameter > 0.q - the upper shape parameter > 0.min - the minimum x value.max - the maximum x value.r - the random number generator.
public static double beta(double min,
double max,
double p,
double q,
double shift,
double stretch,
java.util.Random r)
beta(p, q, 0, 1) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.beta(double, double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the lower shape parameter > 0. Also known as alpha parameterq - the upper shape parameter > 0. Also known as beta parametershift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public int binomial(double p)
n set
to 1.
Is equivalent to binomial(p, 1).
For more details see binomial(double,int).
p - the p parameter of the Binomial distribution, i.e.
the probability of the event occurrence.
public int binomial(double p,
int n)
p - the probability of the event occurrence.n - the number of trials.
public double binomial(double min,
double max,
double p,
double n,
double shift,
double stretch)
binomial(p, n) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.binomial(double, int)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the probability of the event occurrence.n - the number of trials. If n is not an
integer it will be rounded to the nearest integer.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static int binomial(double p,
int n,
java.util.Random r)
p - the probability of the event occurrence.n - the number of trials.r - the random number generator.
public static double binomial(double min,
double max,
double p,
double n,
double shift,
double stretch,
java.util.Random r)
binomial(p, n) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.binomial(double, int)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the probability of the event occurrence.n - the number of trials. If n is not an
integer it will be rounded to the nearest integer.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public double cauchy(double lambda)
theta
set to 0.
Is equivalent to cauchy(lambda, 0).
For more details see cauchy(double,double).
lambda - the scaling parameter > 0.
public double cauchy(double lambda,
double theta)
lambda - the scaling parameter > 0.theta - the mode, or central peak position.
public static double cauchy(double lambda,
double theta,
java.util.Random r)
cauchy(double,double).
lambda - the scaling parameter > 0.theta - the mode, or central peak position.r - the random number generator.
public double chi2(double nu)
min
set to 0.
Is equivalent to chi2(nu, 0).
For more details see chi2(double,double)
nu - the shape parameter.
public double chi2(double nu,
double min)
nu - the shape parameter.min - the minimum x value.
public static double chi2(double nu,
double min,
java.util.Random r)
chi2(double,double).
nu - the shape parameter.min - the minimum x value.r - the random number generator.
public double erlang(double beta,
int m)
min
set to 0.
Is equivalent to erlang(beta, m, 0).
For more details see erlang(double,int,double)/
beta - the scale factor > 0.m - the shape factor (positive integer).
public double erlang(double beta,
int m,
double min)
beta - the scale factor > 0.m - the shape factor (positive integer).min - the minimum x value.
public static double erlang(double beta,
int m,
double min,
java.util.Random r)
erlang(double,int,double).
beta - the scale factor > 0.m - the shape factor (positive integer).min - the minimum x value.r - the random number generator.
public double exponential()
lambda set to 1 and min set to
0.
Is equivalent to exponential(1, 0).
For more details see exponential(double,double)
public double exponential(double lambda)
min set to 0.
Is equivalent to exponential(lambda, 0).
For more details see exponential(double,double).
lambda - the shape parameter.
public double exponential(double lambda,
double min)
lambda - the shape parameter.min - the minimum x value.
public double exponential(double min,
double max,
double shift,
double stretch)
exponential(1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.exponential(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static double exponential(double lambda,
double min,
java.util.Random r)
exponential(double,double).
lambda - the shape parameter.min - the minimum x value.r - the random number generator.
public static double exponential(double min,
double max,
double shift,
double stretch,
java.util.Random r)
exponential(1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.exponential(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public double gamma(double alpha,
double beta)
min set
to 0.
Is equivalent to gamma(alpha, beta, 0).
For more details see gamma(double,double,double).
alpha - the shape parameter > 0.beta - the scale parameter > 0.
public double gamma(double alpha,
double beta,
double min)
alpha - the shape parameter > 0.beta - the scale parameter > 0.min - the minimum x value.
public double gamma(double min,
double max,
double alpha,
double shift,
double stretch)
gamma(alpha, 1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.gamma(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".alpha - the shape parameter > 0. Also known as order.
If less than 1, then 1 will be used.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static double gamma(double alpha,
double beta,
double min,
java.util.Random r)
gamma(double,double,double).
alpha - the shape parameter > 0.beta - the scale parameter > 0.min - the minimum x value.r - the random number generator.
public static double gamma_frac(double a,
java.util.Random r)
public static double gamma(double min,
double max,
double alpha,
double shift,
double stretch,
java.util.Random r)
gamma(alpha, 1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.gamma(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".alpha - the shape parameter > 0. Also known as order.
If less than 1, then 1 will be used.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public int geometric(double p)
geometric( p ) - 1.
The Geometric distribution has been used for inventory demand,
marketing survey returns, a ticket control problem, and
meteorological models.
p - the probability of occurrence.
public static int geometric(double p,
java.util.Random r)
geometric(double).
p - the probability of occurrence.r - the random number generator.
public int hypergeometric(int ss,
int dn,
int ps)
ss - the sample size.dn - the number of defects in the population.ps - the size of the population.
public static int hypergeometric(int ss,
int dn,
int ps,
java.util.Random r)
hypergeometric(int,int,int).
ss - the sample size.dn - the number of defects in the population.ps - the size of the population.
public double gumbel1(double a,
double b)
p(x) = a b exp(-(b exp(-ax) + ax))
a - the 'a' parameterb - the 'b' parameter
public static double gumbel1(double a,
double b,
java.util.Random r)
gumbel1(double,double).
a - the 'a' parameterb - the 'b' parameterr - the random number generator.
public double gumbel2(double a,
double b)
p(x) = b a x^-(a+1) exp(-b x^-a))
a - the 'a' parameterb - the 'b' parameter
public static double gumbel2(double a,
double b,
java.util.Random r)
gumbel2(double,double).
a - the 'a' parameterb - the 'b' parameterr - the random number generator.
public double laplace(double phi,
double theta)
phi - the scaling parameter.theta - the mode, or central peak position.
public static double laplace(double phi,
double theta,
java.util.Random r)
laplace(double,double).
phi - the scaling parameter.theta - the mode, or central peak position.r - the random number generator.
public int logarithmic(double theta)
theta - the shape/scale parameter 0
public static int logarithmic(double theta,
java.util.Random r)
logarithmic(double).
theta - the shape/scale parameter 0r - the random number generator.
public double logistic(double beta,
double alpha)
beta - the scale parameter > 0.alpha - the shift parameter.
public static double logistic(double beta,
double alpha,
java.util.Random r)
logistic(double,double).
beta - the scale parameter > 0.alpha - the shift parameter.r - the random number generator.
public double lognormal(double mu,
double sigma,
double min)
mu - the mean of the included Normal.sigma - the standard deviation of the included Normal.min - the minimum x value.
public static double lognormal(double mu,
double sigma,
double min,
java.util.Random r)
lognormal(double,double,double).
mu - the mean of the included Normal.sigma - the standard deviation of the included Normal.min - the minimum x value.r - the random number generator.
public int negativeBinomial(double p,
double n)
p - the probability of event (in the interval [0,1]).n - the number of desired events.
public double negativeBinomial(double min,
double max,
double p,
double n,
double shift,
double stretch)
negativeBinomial(p, n) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.negativeBinomial(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the probability of the event occurrence.n - the number of trials. If n is not an
integer it will be rounded to the nearest integer.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static int negativeBinomial(double p,
double n,
java.util.Random r)
negativeBinomial(double,double).
p - the probability of event (in the interval [0,1]).n - the number of desired events.r - the random number generator.
public static double negativeBinomial(double min,
double max,
double p,
double n,
double shift,
double stretch,
java.util.Random r)
negativeBinomial(p, n) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.negativeBinomial(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".p - the probability of the event occurrence.n - the number of trials. If n is not an
integer it will be rounded to the nearest integer.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public double normal()
mean set
to 0 and sigma set to 1.
Is equivalent to normal(1, 0).
For more details see normal(double,double).
public double normal(double sigma)
mean set
to 0.
Is equivalent to normal(sigma, 0).
For more details see normal(double,double)
sigma - the shape parameter = standard deviation.
public double normal(double sigma,
double mean)
sigma - the shape parameter = standard deviation.mean - the shift parameter = mean value.
public double normal(double min,
double max,
double shift,
double stretch)
normal(1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.normal(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the right = mean valuestretch - the stretch parameter that indicates how much the
distribution will be stretched = standard deviation
public static double normal(double sigma,
double mean,
java.util.Random r)
normal(double,double)
sigma - the shape parameter = standard deviation.mean - the shift parameter = mean value.r - the random number generator.
public static double normal(double min,
double max,
double shift,
double stretch,
java.util.Random r)
normal(1, 0) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.normal(double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the right = mean valuestretch - the stretch parameter that indicates how much the
distribution will be stretched = standard deviationr - the random number generator.
public double pareto(double alpha)
min set
to 1.
Is equivalent to pareto(alpha, 1).
For more details see pareto(double,double)
alpha - the scale parameter > 0.
public double pareto(double alpha,
double min)
alpha - the scale parameter > 0.min - the minimum x value.
public static double pareto(double alpha,
double min,
java.util.Random r)
pareto(double,double).
alpha - the scale parameter > 0.min - the minimum x value.r - the random number generator.
public int poisson(double lambda)
lambda - the rate of occurrence.
public double poisson(double min,
double max,
double mean,
double shift,
double stretch)
poisson(mean) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.poisson(double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".mean - the mean value for the distribution = rate of event occurrenceshift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretched
public static int poisson(double lambda,
java.util.Random r)
poisson(double).
lambda - the rate of occurrence.r - the random number generator.
public static double poisson(double min,
double max,
double mean,
double shift,
double stretch,
java.util.Random r)
poisson(mean) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.poisson(double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".mean - the mean value for the distribution = rate of event occurrenceshift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the stretch parameter that indicates how much the
distribution will be stretchedr - the random number generator.
public double rayleigh(double sigma)
min
set to 0.
Is equivalent to rayleigh(sigma, 0).
For more details see rayleigh(double,double)
sigma - the scale parameter > 0.
public double rayleigh(double sigma,
double min)
sigma - the scale parameter > 0.min - the minimum x value.
public static double rayleigh(double sigma,
double min,
java.util.Random r)
rayleigh(double,double)
sigma - the scale parameter > 0.min - the minimum x value.r - the random number generator.
public double triangular(double min,
double max)
mode set to (min + max)/2.
Is equivalent to triangular(min, (min + max)/2, max).
For more details see triangular(double,double,double).
min - the minimum x value.max - the maximum x value.
public double triangular(double min,
double max,
double mode)
min - the minimum x value.max - the maximum x value.mode - the most likely x value.
public double triangular(double min,
double max,
double left,
double mode,
double right)
triangular(left, right, mode) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.triangular(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".left - the minimum x value for triangular distribution.mode - the most likely x value for triangular distribution.right - the maximum x value for triangular distribution.
public static double triangular(double min,
double max,
double mode,
java.util.Random r)
triangular(double,double,double).
min - the minimum x value.max - the maximum x value.mode - the most likely x value.r - the random number generator.
public static double triangular(double min,
double max,
double left,
double mode,
double right,
java.util.Random r)
triangular(left, right, mode) is stretched by
stretch coefficient, then shifted to the right
by shift, after that it is truncated to fit in
[min, max] interval. Truncation is performed by discarding
every sample outside this interval and taking subsequent try.triangular(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".left - the minimum x value for triangular distribution.mode - the most likely x value for triangular distribution.right - the maximum x value for triangular distribution.r - the random number generator.
public double pert(double min,
double max,
double mode)
min - the minimum x value.max - the maximum x value.mode - the most likely x value.
public static double pert(double min,
double max,
double mode,
java.util.Random r)
pert(double, double, double)
min - the minimum x value.mode - the most likely x value.max - the maximum x value.r - the random number generator.
public double weibull(double beta,
double alpha)
min set to 0.
Is equivalent to weibull(alpha, beta, 0).
For more details see weibull(double,double,double).
beta - the scale parameter > 0.alpha - the shape parameter > 0.
public double weibull(double alpha,
double beta,
double min)
alpha - the shape parameter > 0.beta - the scale parameter > 0.min - the minimum x value.
public double weibull(double min,
double max,
double alpha,
double shift,
double stretch)
weibull(alpha, stretch, 0)
is shifted to the right by shift and then truncated
to fit in [min, max] interval.
Truncation is performed by discarding every sample outside
this interval and taking subsequent try.weibull(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".alpha - the shape parameter > 0.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the scale parameter.
public static double weibull(double alpha,
double beta,
double min,
java.util.Random r)
weibull(double,double,double).
alpha - the shape parameter > 0.beta - the scale parameter > 0.min - the minimum x value.r - the random number generator.
public static double weibull(double min,
double max,
double alpha,
double shift,
double stretch,
java.util.Random r)
weibull(alpha, stretch, 0)
is shifted to the right by shift and then truncated
to fit in [min, max] interval.
Truncation is performed by discarding every sample outside
this interval and taking subsequent try.weibull(double, double, double)
min - the minimum value that this function will return.
The distribution is truncated to return values above this.
If the sample (stretched and shifted) is below this value
it will be discarded and another sample will be drawn.
Use Double.NEGATIVE_INFINITY for "No limit".max - the maximum value that this function will return.
The distribution is truncated to return values below this.
If the sample (stretched and shifted) is bigger than this value
it will be discarded and another sample will be drawn.
Use Double.POSITIVE_INFINITY for "No limit".alpha - the shape parameter > 0.shift - the shift parameter that indicates how much the
(stretched) distribution will shifted to the rightstretch - the scale parameter.r - the random number generator.
public static double sqr(double v)
v2)
v - the value
v * v
public static double getLength(double dx,
double dy)
(dx, dy)
dx - the x coordinate of the vectordy - the y coordinate of the vector
(dx, dy)
public static double getLength(double dx,
double dy,
double dz)
(dx, dy, dz)
dx - the x coordinate of the vectordy - the y coordinate of the vectordz - the z coordinate of the vector
(dx, dy, dz)
public static double getDistance(double x1,
double y1,
double x2,
double y2)
(x1, y1) and (x2, y2)
x1 - the x coordinate of the first pointy1 - the y coordinate of the first pointx2 - the x coordinate of the second pointy2 - the y coordinate of the second point
public static double getDistanceSq(double x1,
double y1,
double x2,
double y2)
(x1, y1) and (x2, y2).getDistance()
x1 - the x coordinate of the first pointy1 - the y coordinate of the first pointx2 - the x coordinate of the second pointy2 - the y coordinate of the second point
public static double getDistance(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
(x1, y1, z1) and (x2, y2, z2)
x1 - the x coordinate of the first pointy1 - the y coordinate of the first pointz1 - the z coordinate of the first pointx2 - the x coordinate of the second pointy2 - the y coordinate of the second pointz2 - the z coordinate of the second point
public static double getDistanceSq(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
(x1, y1, z1) and (x2, y2, z2).getDistance()
x1 - the x coordinate of the first pointy1 - the y coordinate of the first pointz1 - the z coordinate of the first pointx2 - the x coordinate of the second pointy2 - the y coordinate of the second pointz2 - the z coordinate of the second point
public static boolean isPointOnTheSameLine(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
x1 - the X coordinate of point 1y1 - the Y coordinate of point 1x2 - the X coordinate of point 2y2 - the Y coordinate of point 2x3 - the X coordinate of point 3y3 - the Y coordinate of point 3
true if 3 points lie on one line,
otherwise false
public static boolean isPointInsideRectangle(double rx,
double ry,
double rw,
double rh,
double px,
double py)
rx - the X coordinate of top-left corner of the rectanglery - the Y coordinate of top-left corner of the rectanglerw - the width of the rectanglerh - the height of the rectanglepx - the X coordinate of the point to testpy - the Y coordinate of the point to test
true if the point is within the rectangle boundary,
otherwise false
public static boolean isLineIntersectingLine(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4)
(x1,y1) to (x2,y2)
intersects the line segment from (x3,y3) to (x4,y4).
x1 - the X coordinate of the start point of the first specified
line segmenty1 - the Y coordinate of the start point of the first specified
line segmentx2 - the X coordinate of the end point of the first specified line
segmenty2 - the Y coordinate of the end point of the first specified line
segmentx3 - the X coordinate of the start point of the second specified
line segmenty3 - the Y coordinate of the start point of the second specified
line segmentx4 - the X coordinate of the end point of the second specified line
segmenty4 - the Y coordinate of the end point of the second specified line
segment
true if the first specified line segment and the
second specified line segment intersect each other;
false otherwise.
public static boolean isLineIntersectingRectangle(double x1,
double y1,
double x2,
double y2,
double rx,
double ry,
double rw,
double rh)
x1 - the X coordinate of the start point of the specified liney1 - the Y coordinate of the start point of the specified linex2 - the X coordinate of the end point of the specified liney2 - the Y coordinate of the end point of the specified linerx - the X coordinate of top-left corner of the rectanglery - the Y coordinate of top-left corner of the rectanglerw - the width of the rectanglerh - the height of the rectangle
true if the line intersects rectangle (has at least
one common point, even lying on the rectangle's boundary)
public static double getDistanceFromPointToLine(double x1,
double y1,
double x2,
double y2,
double px,
double py)
x1 - the X coordinate of the start point of the specified liney1 - the Y coordinate of the start point of the specified linex2 - the X coordinate of the end point of the specified liney2 - the Y coordinate of the end point of the specified linepx - the X coordinate of the specified point being measured against
the specified linepy - the Y coordinate of the specified point being measured against
the specified line
getDistanceFromPointToSegment(double, double, double, double, double, double)
public static double getDistanceFromPointToLineSq(double x1,
double y1,
double x2,
double y2,
double px,
double py)
x1 - the X coordinate of the start point of the specified liney1 - the Y coordinate of the start point of the specified linex2 - the X coordinate of the end point of the specified liney2 - the Y coordinate of the end point of the specified linepx - the X coordinate of the specified point being measured against
the specified linepy - the Y coordinate of the specified point being measured against
the specified line
getDistanceFromPointToSegmentSq(double, double, double, double, double, double)
public static double getDistanceFromPointToSegment(double x1,
double y1,
double x2,
double y2,
double px,
double py)
x1 - the X coordinate of the start point of the specified line
segmenty1 - the Y coordinate of the start point of the specified line
segmentx2 - the X coordinate of the end point of the specified line
segmenty2 - the Y coordinate of the end point of the specified line
segmentpx - the X coordinate of the specified point being measured against
the specified line segmentpy - the Y coordinate of the specified point being measured against
the specified line segment
getDistanceFromPointToLine(double, double, double, double, double, double)
public static double getDistanceFromPointToSegmentSq(double x1,
double y1,
double x2,
double y2,
double px,
double py)
x1 - the X coordinate of the start point of the specified line
segmenty1 - the Y coordinate of the start point of the specified line
segmentx2 - the X coordinate of the end point of the specified line
segmenty2 - the Y coordinate of the end point of the specified line
segmentpx - the X coordinate of the specified point being measured against
the specified line segmentpy - the Y coordinate of the specified point being measured against
the specified line segment
getDistanceFromPointToLineSq(double, double, double, double, double, double)
public static double zidz(double a,
double b)
a - first valueb - second value
public static double xidz(double a,
double b,
double x)
a - first valueb - second valuex - defines return result in case of unsuccessful division
public static double limitMin(double min,
double x)
max as explicitly
says "x is left-limited by min".
min - left boundx - the value
public static double limitMax(double x,
double max)
min as explicitly
says "x is right-limited by max".
x - the valuemax - right bound
public static double limit(double min,
double x,
double max)
min - left boundx - the valuemax - right bound
public static double gammaLog(double x)
x:ln(Γ(x)).x.n is a positive integer, then: Γ(n) = (n - 1)!.gammaLog function may be useful in System Dynamics
models for computing combinatorial factors.
x - the value.
ln(Γ(x))
public double step(double height,
double stepTime)
0 until the stepTime and then returns height
height - stepTime -
0 until the stepTime and then returns height
public double pulse(double startTime,
double pulseWidth)
1, starting at startTime, and lasting
for interval pulseWidth; 0 is returned at all other times.
startTime - the pulse start timepulseWidth - the length of pulse time interval
1 for pulse (when time is within [start, start+width)),
otherwise 0
public double pulseTrain(double startTime,
double pulseWidth,
double timeBetweenPulses,
double endTime)
1, starting at startTime, and lasting for
interval pulseWidth and then repeats this pattern every
timeBetweenPulses time until endTime;
0 is returned at all other times.timeBetweenPulses is smaller than pulseWidth
then 1 will be returned between startTime and endTime.
startTime - the first pulse start timepulseWidth - the length of pulse time intervaltimeBetweenPulses - the length of time interval between starts pulsesendTime - the end time of pulses, since this time the method returns 0
1 for pulses, 0 otherwise
public double ramp(double slope,
double startTime,
double endTime)
0 until the startTime and then slopes upward
until endTime and then holds constant.
slope - the coefficient of returned value growth between startTime and endTimestartTime - the start time of the rampendTime - the end time of the ramp
startTime, then slope
until endTime and then constant.
public static double quantum(double value,
double quantizer)
value that is an
integer multiple of quantizer.quantizer is less than or equal to zero, then
value is returned unchanged.
value - quantizer -
value
public static double difference(DataSet ds,
TableFunction f)
ds - data setf - table function with linear interpolation
public static double difference(DataSet ds1,
DataSet ds2)
ds1 - data setds2 - data set
public double millisecond()
public double second()
public double minute()
public double hour()
public double day()
public double week()
public static java.lang.String briefInfoOn(java.lang.Object object)
object - the obejct to give info on
public static java.lang.String inspectOf(java.lang.Object object)
object - the object being inspected
public static void copyToClipboard(java.lang.String s)
s - the text to put on the clipboardpublic static java.lang.String format(double value)
value - the double value to be formatted.
public static java.lang.String format(int value)
value - the integer value to be formatted.
public static java.lang.String format(long value)
value - the long value to be formatted.
public static java.lang.String format(java.util.Date date)
date - the date to be formatted.
public static java.lang.String formatDayOfWeek(int dayOfWeek,
boolean fullName)
dayOfWeek - one of MONDAY, TUESDAY, ... contantsfullName - if true, then returns the full name
("Monday", "Tuesday", etc.), otherwise - short ("Mon", "Tue", etc.)
public static java.lang.String formatMonth(int month,
boolean fullName)
month - one of JANUARY, FEBRUARY, ... contantsfullName - if true, then returns the full name
("January", "February", etc.), otherwise - short ("Jan", "Feb", etc.)
public static java.lang.String format(boolean value)
value - the boolean value to be formatted.
public static java.lang.String format(char value)
String
value - the character value to be formatted.
public java.lang.String formatTimeInterval(double dt)
dt - the time interval
public static java.lang.String formatLongitude(double degrees)
degrees - the longitude in decimal degrees
E30°20'0"public static java.lang.String formatLatitude(double degrees)
degrees - the latitude in decimal degrees
N59°56'0"public static java.lang.String formatGeoHeading(double radians)
PI / 7 will be formatted as "26° NNE"
radians - the heading angle (measured in radians CW,
starting from North direction)
public static double toLatitude(int degrees,
int minutes,
double seconds,
boolean northOrSouth)
degrees - number of degrees, 0...90minutes - number of minutes (1/60 of degree),
0...59seconds - number of seconds (1/60 of minute),
0 <= seconds < 60northOrSouth - true for North, false for South
public static double toLongitude(int degrees,
int minutes,
double seconds,
boolean eastOrWest)
degrees - number of degrees, 0...180minutes - number of minutes (1/60 of degree),
0...59seconds - number of seconds (1/60 of minute),
0 <= seconds < 60eastOrWest - true for East, false for West
public static java.util.Date toDate(int year,
int month,
int day,
int hourOfDay,
int minute,
int second)
year - the yearmonth - the month, is 0-based. e.g., 0 for January.JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
UNDECIMBER (indicates the
thirteenth month of the year. Although GregorianCalendar
does not use this value, lunar calendars do)
day - the day of the monthhourOfDay - the hour of day (using 24-hour clock)minute - the minutesecond - the second
public static long toDateInMillis(int year,
int month,
int day,
int hourOfDay,
int minute,
int second)
toDate(int, int, int, int, int, int) but returns the date
in its milliseconds representation (see Date.getTime()), i.e.
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the date.
toDate(int, int, int, int, int, int),
Date.getTime()public static java.net.URL createURL_xjal(java.lang.String url)
URL object from the String representation
url - the String to parse as a URL.
URL objectpublic static void prepareBeforeExperimentStart_xjal(java.lang.Class<?> experimentClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||