Package jason.stdlib
Class set_random_seed
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.set_random_seed
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal="math.set_random_seed(seed)", hint="generates a random number between 0 and 1", argsHint="sets the seed of Jason\'s random number generator", argsType="number", examples=".set_random_seed(20): sets the random number generator\'s seed to 20", seeAlso={"jason.functions.Random","jason.stdlib.random"}) public class set_random_seed extends DefaultInternalAction
Internal action: .set_random_seed(N)
.
Description: sets the seed of Jason's random number generator
Parameter:
- - seed (number): the value to which the random seed is to be set
Example:
.set_random_seed(20)
: Sets the random number generator's seed to 20.
- See Also:
Random
,random
, Serialized Form
-
Constructor Summary
Constructors Constructor Description set_random_seed()
-
Method Summary
Modifier and Type Method Description java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.static java.util.Random
getAgRandomIA(TransitionSystem ts)
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, getMaxArgs, getMinArgs, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
set_random_seed
public set_random_seed()
-
-
Method Details
-
getAgRandomIA
- Throws:
java.lang.Exception
-
execute
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classDefaultInternalAction
- Throws:
java.lang.Exception
-