Package jason.functions
Class Random
java.lang.Object
jason.asSemantics.DefaultArithFunction
jason.functions.Random
- All Implemented Interfaces:
ArithFunction,Serializable
Function: math.random(N): encapsulates java Math.random;
If N is not informed: returns a value greater than or equal to 0.0 and less than 1.0;
If N is informed: returns a value greater than or equal to 0.0 and less than N.
Examples:
-
math.random: returns the random number between 0 and 1. -
math.random(10): returns the random number between 0 and 9.9999.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArity(int a) returns true if a is a good number of arguments for the functiondoubleevaluate(TransitionSystem ts, Term[] args) evaluates/computes the function based on the argsgetName()returns the name of the functionMethods inherited from class jason.asSemantics.DefaultArithFunction
allowUngroundTerms, toString
-
Constructor Details
-
Random
public Random()
-
-
Method Details
-
getName
Description copied from interface:ArithFunctionreturns the name of the function- Specified by:
getNamein interfaceArithFunction- Overrides:
getNamein classDefaultArithFunction
-
evaluate
Description copied from interface:ArithFunctionevaluates/computes the function based on the args- Specified by:
evaluatein interfaceArithFunction- Overrides:
evaluatein classDefaultArithFunction- Throws:
Exception
-
checkArity
public boolean checkArity(int a) Description copied from interface:ArithFunctionreturns true if a is a good number of arguments for the function- Specified by:
checkArityin interfaceArithFunction- Overrides:
checkArityin classDefaultArithFunction
-