Package modelarium.entities.generators
Class FunctionalDefaultAgentGenerator
java.lang.Object
modelarium.entities.generators.AgentGenerator
modelarium.entities.generators.DefaultAgentGenerator
modelarium.entities.generators.FunctionalDefaultAgentGenerator
Class for generating agents (via a default generator) by delegating creation logic to a user-defined function.
This implementation of DefaultAgentGenerator is intended for flexibility and cross-language use
(e.g. from Python).
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionalDefaultAgentGenerator(BiFunction<Config, RandomGenerator, Agent> generatorFunction) Constructs a new generator with the specified logic. -
Method Summary
Modifier and TypeMethodDescriptionprotected AgentgenerateAgent(Config config, RandomGenerator random) Generates a single agent by applying the user-provided generator function.Methods inherited from class modelarium.entities.generators.DefaultAgentGenerator
generateAgents, generateAgentsForEachThreadMethods inherited from class modelarium.entities.generators.AgentGenerator
reset
-
Constructor Details
-
FunctionalDefaultAgentGenerator
Constructs a new generator with the specified logic.- Parameters:
generatorFunction- the function used to generate each agent
-
-
Method Details
-
generateAgent
Generates a single agent by applying the user-provided generator function.- Specified by:
generateAgentin classDefaultAgentGenerator- Parameters:
config- the model settings passed to the agent during creationrandom- the random generator the agent generator can use for constructing agents- Returns:
- a new
Agentinstance
-