Package modelarium.agents
Class FunctionalAgentGenerator
java.lang.Object
modelarium.agents.AgentGenerator
modelarium.agents.FunctionalAgentGenerator
An implementation of
AgentGenerator that delegates agent creation logic
to a user-defined functional interface.
Intended for flexibility and cross-language use (e.g. from Python).
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionalAgentGenerator(Function<ModelSettings, Agent> generatorFunction) Constructs a new generator with the specified logic. -
Method Summary
Modifier and TypeMethodDescriptionprotected AgentgenerateAgent(ModelSettings modelSettings) Abstract method for generating a single agent instance.Methods inherited from class modelarium.agents.AgentGenerator
generateAgents, getAgentsForEachCore
-
Constructor Details
-
FunctionalAgentGenerator
Constructs a new generator with the specified logic.- Parameters:
generatorFunction- the function used to generate each agent
-
-
Method Details
-
generateAgent
Description copied from class:AgentGeneratorAbstract method for generating a single agent instance. Must be implemented by concrete subclasses.- Specified by:
generateAgentin classAgentGenerator- Parameters:
modelSettings- the model settings passed to the agent during creation- Returns:
- a new
Agentinstance
-