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 Details

    • set_random_seed

      public set_random_seed()
  • Method Details

    • getAgRandomIA

      public static java.util.Random getAgRandomIA​(TransitionSystem ts) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • execute

      public java.lang.Object execute​(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.Exception
      Description 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 interface InternalAction
      Overrides:
      execute in class DefaultInternalAction
      Throws:
      java.lang.Exception