Package modelarium.entities.generators
Class EnvironmentGenerator
java.lang.Object
modelarium.entities.generators.EnvironmentGenerator
- Direct Known Subclasses:
FunctionalEnvironmentGenerator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract EnvironmentgenerateEnvironment(Config config, RandomGenerator random) Creates and returns a fully initialisedEnvironmentfor the simulation.protected voidreset()Resets any temporary state retained while generating an environment.
-
Constructor Details
-
EnvironmentGenerator
public EnvironmentGenerator()Constructs an environment generator.
-
-
Method Details
-
generateEnvironment
Creates and returns a fully initialisedEnvironmentfor the simulation.- Parameters:
config- the global model settings used to configure the environmentrandom- the random generator the environment generator can use for constructing an environment- Returns:
- a new
Environmentinstance
-
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.
-