Package modelarium
Record Class Config
java.lang.Object
java.lang.Record
modelarium.Config
- Record Components:
populationSize- the number of agents the model will containtickCount- the number of time steps the model will performthreadCount- the number of worker threads the model will usethreadTimeout- the maximum duration a thread should wait for a response from another threadareThreadsSynced- whether the threads are synchronised or not, determining if interaction of entities over multiple threads is possibleagentGenerator- an instance of an agent generator class which is used by the model to generate agentsenvironmentGenerator- an instance of an environment generator class which is used by the model to generate an environmentscheduler- an instance of a scheduler class which is used by the model to order the running of each agent as the model progressesrunLogDatabaseFactory- an instance of an attribute set log database factory which the model uses to create a database that can store attribute logs as the model progressesseed- the seed value used for the core random generator used by the model
public record Config(int populationSize, int tickCount, int threadCount, Duration threadTimeout, boolean areThreadsSynced, AgentGenerator agentGenerator, EnvironmentGenerator environmentGenerator, Scheduler scheduler, AttributeSetLogDatabaseFactory runLogDatabaseFactory, long seed)
extends Record
Record for containing the configuration settings of a model.
This record is responsible for storing the configurations needed for running a model. It includes a static builder
class (Config.ConfigBuilder) that can be used to assist in the construction of an instance of this record.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass for assisting in the constructing of aConfigrecord. -
Constructor Summary
ConstructorsConstructorDescriptionConfig(int populationSize, int tickCount, int threadCount, Duration threadTimeout, boolean areThreadsSynced, AgentGenerator agentGenerator, EnvironmentGenerator environmentGenerator, Scheduler scheduler, AttributeSetLogDatabaseFactory runLogDatabaseFactory, long seed) Validates the invariants shared by direct construction andConfig.ConfigBuilderconstruction. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagentGeneratorrecord component.booleanReturns the value of theareThreadsSyncedrecord component.static Config.ConfigBuilderbuilder()Creates a new instance ofConfig.ConfigBuilderthat can assist in the construction of aConfigrecord.Returns the value of theenvironmentGeneratorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepopulationSizerecord component.Returns the value of therunLogDatabaseFactoryrecord component.Returns the value of theschedulerrecord component.longseed()Returns the value of theseedrecord component.intReturns the value of thethreadCountrecord component.Returns the value of thethreadTimeoutrecord component.intReturns the value of thetickCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Config
public Config(int populationSize, int tickCount, int threadCount, Duration threadTimeout, boolean areThreadsSynced, AgentGenerator agentGenerator, EnvironmentGenerator environmentGenerator, Scheduler scheduler, AttributeSetLogDatabaseFactory runLogDatabaseFactory, long seed) Validates the invariants shared by direct construction andConfig.ConfigBuilderconstruction.
-
-
Method Details
-
builder
Creates a new instance ofConfig.ConfigBuilderthat can assist in the construction of aConfigrecord.- Returns:
- a new
Config.ConfigBuilderinstance
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
populationSize
public int populationSize()Returns the value of thepopulationSizerecord component.- Returns:
- the value of the
populationSizerecord component
-
tickCount
public int tickCount()Returns the value of thetickCountrecord component.- Returns:
- the value of the
tickCountrecord component
-
threadCount
public int threadCount()Returns the value of thethreadCountrecord component.- Returns:
- the value of the
threadCountrecord component
-
threadTimeout
Returns the value of thethreadTimeoutrecord component.- Returns:
- the value of the
threadTimeoutrecord component
-
areThreadsSynced
public boolean areThreadsSynced()Returns the value of theareThreadsSyncedrecord component.- Returns:
- the value of the
areThreadsSyncedrecord component
-
agentGenerator
Returns the value of theagentGeneratorrecord component.- Returns:
- the value of the
agentGeneratorrecord component
-
environmentGenerator
Returns the value of theenvironmentGeneratorrecord component.- Returns:
- the value of the
environmentGeneratorrecord component
-
scheduler
Returns the value of theschedulerrecord component.- Returns:
- the value of the
schedulerrecord component
-
runLogDatabaseFactory
Returns the value of therunLogDatabaseFactoryrecord component.- Returns:
- the value of the
runLogDatabaseFactoryrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-