Package modelarium.environments
Class FunctionalEnvironmentGenerator
java.lang.Object
modelarium.environments.EnvironmentGenerator
modelarium.environments.FunctionalEnvironmentGenerator
A functional implementation of
EnvironmentGenerator that delegates
environment creation to a user-provided function.
Useful when working across languages (e.g. from Python), or when modular configuration is required without subclassing.
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionalEnvironmentGenerator(Function<ModelSettings, Environment> generatorFunction) Constructs a new functional generator. -
Method Summary
Modifier and TypeMethodDescriptiongenerateEnvironment(ModelSettings modelSettings) Creates and returns a fully initialisedEnvironmentfor the simulation.
-
Constructor Details
-
FunctionalEnvironmentGenerator
Constructs a new functional generator.- Parameters:
generatorFunction- the function used to generate the environment
-
-
Method Details
-
generateEnvironment
Description copied from class:EnvironmentGeneratorCreates and returns a fully initialisedEnvironmentfor the simulation.- Specified by:
generateEnvironmentin classEnvironmentGenerator- Parameters:
modelSettings- the global model settings used to configure the environment- Returns:
- a new
Environmentinstance
-