Class Randomness

java.lang.Object
madkit.random.Randomness

public class Randomness extends Object
Provides various utility methods related to randomness with MaDKit.
  • Constructor Details

    • Randomness

      public Randomness()
  • Method Details

    • randomizeFields

      public static void randomizeFields(Object object, RandomGenerator prng)
      Randomizes the values of the fields of the object. The fields to be randomized are marked with the annotations RandomizedDouble, RandomizedInteger, and RandomizedBoolean. For Agent subclasses, the randomizeFields(Object, RandomGenerator) is automatically called by the kernel just before the agent is launched, unless MadkitOptions.randomizeFields is set to false.
      Parameters:
      object - the object whose fields are to be randomized
      prng - the pseudo-random number generator to be used
      Throws:
      AgentRuntimeException - if a field cannot be accessed
    • getBestRandomGeneratorFactory

      public static RandomGeneratorFactory<RandomGenerator> getBestRandomGeneratorFactory()
      Returns the best random generator factory considering the capabilities of current system and the highest number of state bits.
      Returns:
      the best random generator factory