Class Randomness
java.lang.Object
madkit.random.Randomness
Provides various utility methods related to randomness with MaDKit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the best random generator factory considering the capabilities of current system and the highest number of state bits.static void
randomizeFields
(Object object, RandomGenerator prng) Randomizes the values of the fields of the object.
-
Constructor Details
-
Randomness
public Randomness()
-
-
Method Details
-
randomizeFields
Randomizes the values of the fields of the object. The fields to be randomized are marked with the annotationsRandomizedDouble
,RandomizedInteger
, andRandomizedBoolean
. For Agent subclasses, therandomizeFields(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 randomizedprng
- the pseudo-random number generator to be used- Throws:
AgentRuntimeException
- if a field cannot be accessed
-
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
-