Class JmcRandom

java.lang.Object
java.util.Random
org.mpi_sws.jmc.api.util.JmcRandom
All Implemented Interfaces:
Serializable, RandomGenerator

public class JmcRandom extends Random
A JMC-specific implementation of java.util.Random that allows for model checking. This class overrides the next method to yield control to the JMC runtime, allowing for reactive event handling and model checking.
See Also:
  • Constructor Details

    • JmcRandom

      public JmcRandom()
      Default constructor for JmcRandom. Ignores the seed
    • JmcRandom

      public JmcRandom(long seed)
      To ensure compatibility with the java.util.Random API, this constructor is provided. Ignores the seed.
  • Method Details

    • next

      public int next(int bits)
      This method is overridden to yield control to the JMC runtime. It allows the JMC model checker to handle reactive events and return a random value.
      Overrides:
      next in class Random
      Parameters:
      bits - the number of bits to generate
      Returns:
      a random integer value based on the specified number of bits