Package org.projog.core.math.builtin
Class Random
- java.lang.Object
-
- org.projog.core.math.AbstractArithmeticOperator
-
- org.projog.core.math.builtin.Random
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,ArithmeticOperator,PreprocessableArithmeticOperator
public final class Random extends AbstractArithmeticOperator
random(X)Evaluate to a random integer i for which 0 =< i < X.
-
-
Constructor Summary
Constructors Constructor Description Random()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Numericcalculate(Numeric n)protected booleanisPure()Random is not pure.-
Methods inherited from class org.projog.core.math.AbstractArithmeticOperator
calculate, calculate, preprocess, setKnowledgeBase
-
-
-
-
Method Detail
-
calculate
public Numeric calculate(Numeric n)
- Overrides:
calculatein classAbstractArithmeticOperator
-
isPure
protected boolean isPure()
Random is not pure. Multiple calls with the same argument do not produce identical results.- Overrides:
isPurein classAbstractArithmeticOperator- Returns:
- true if pure and so can be preprocessed, else false
-
-