Class EnvironmentGenerator

java.lang.Object
modelarium.entities.generators.EnvironmentGenerator
Direct Known Subclasses:
FunctionalEnvironmentGenerator

public abstract class EnvironmentGenerator extends Object
Abstract base class responsible for generating the simulation Environment.

Concrete subclasses should use the Config to construct and return a new instance of Environment, complete with its attribute sets and configuration.

This abstraction allows environments to be modular and varied across different simulations.

  • Constructor Details

    • EnvironmentGenerator

      public EnvironmentGenerator()
      Constructs an environment generator.
  • Method Details

    • generateEnvironment

      public abstract Environment generateEnvironment(Config config, RandomGenerator random)
      Creates and returns a fully initialised Environment for the simulation.
      Parameters:
      config - the global model settings used to configure the environment
      random - the random generator the environment generator can use for constructing an environment
      Returns:
      a new Environment instance
    • reset

      protected void reset()
      Resets any temporary state retained while generating an environment.

      The model calls this hook after every generation attempt, including an attempt which throws. Stateful generators should override it so the same generator can be reused for a later run.