Package modelarium

Record Class Config

Record Components:
populationSize - the number of agents the model will contain
tickCount - the number of time steps the model will perform
threadCount - the number of worker threads the model will use
threadTimeout - the maximum duration a thread should wait for a response from another thread
areThreadsSynced - whether the threads are synchronised or not, determining if interaction of entities over multiple threads is possible
agentGenerator - an instance of an agent generator class which is used by the model to generate agents
environmentGenerator - an instance of an environment generator class which is used by the model to generate an environment
scheduler - an instance of a scheduler class which is used by the model to order the running of each agent as the model progresses
runLogDatabaseFactory - 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 progresses
seed - 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.

  • Constructor Details

  • Method Details

    • builder

      public static Config.ConfigBuilder builder()
      Creates a new instance of Config.ConfigBuilder that can assist in the construction of a Config record.
      Returns:
      a new Config.ConfigBuilder instance
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • populationSize

      public int populationSize()
      Returns the value of the populationSize record component.
      Returns:
      the value of the populationSize record component
    • tickCount

      public int tickCount()
      Returns the value of the tickCount record component.
      Returns:
      the value of the tickCount record component
    • threadCount

      public int threadCount()
      Returns the value of the threadCount record component.
      Returns:
      the value of the threadCount record component
    • threadTimeout

      public Duration threadTimeout()
      Returns the value of the threadTimeout record component.
      Returns:
      the value of the threadTimeout record component
    • areThreadsSynced

      public boolean areThreadsSynced()
      Returns the value of the areThreadsSynced record component.
      Returns:
      the value of the areThreadsSynced record component
    • agentGenerator

      public AgentGenerator agentGenerator()
      Returns the value of the agentGenerator record component.
      Returns:
      the value of the agentGenerator record component
    • environmentGenerator

      public EnvironmentGenerator environmentGenerator()
      Returns the value of the environmentGenerator record component.
      Returns:
      the value of the environmentGenerator record component
    • scheduler

      public Scheduler scheduler()
      Returns the value of the scheduler record component.
      Returns:
      the value of the scheduler record component
    • runLogDatabaseFactory

      public AttributeSetLogDatabaseFactory runLogDatabaseFactory()
      Returns the value of the runLogDatabaseFactory record component.
      Returns:
      the value of the runLogDatabaseFactory record component
    • seed

      public long seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component