Record Class SimulatedAnnealingConfig

java.lang.Object
java.lang.Record
edu.cnu.mdi.sim.simanneal.SimulatedAnnealingConfig
Record Components:
maxSteps - maximum number of iterations; must be positive
stepsPerTemperature - iterations per schedule level, or zero to advance the schedule on every iteration
alpha - geometric cooling factor in (0,1]
minTemperature - non-negative absolute-temperature stopping threshold
progressEverySteps - progress interval, or zero to disable progress posts
refreshEverySteps - refresh interval, or zero to disable refresh requests
randomSeed - deterministic seed, or zero to choose a nondeterministic seed
notificationPolicy - accepted-move listener delivery limits

public record SimulatedAnnealingConfig(long maxSteps, long stepsPerTemperature, double alpha, double minTemperature, long progressEverySteps, long refreshEverySteps, long randomSeed, AnnealingNotificationPolicy notificationPolicy) extends Record
Configuration for a simulated-annealing run.
  • Constructor Details

    • SimulatedAnnealingConfig

      public SimulatedAnnealingConfig(long maxSteps, long stepsPerTemperature, double alpha, double minTemperature, long progressEverySteps, long refreshEverySteps, long randomSeed, AnnealingNotificationPolicy notificationPolicy)
      Creates an instance of a SimulatedAnnealingConfig record class.
      Parameters:
      maxSteps - the value for the maxSteps record component
      stepsPerTemperature - the value for the stepsPerTemperature record component
      alpha - the value for the alpha record component
      minTemperature - the value for the minTemperature record component
      progressEverySteps - the value for the progressEverySteps record component
      refreshEverySteps - the value for the refreshEverySteps record component
      randomSeed - the value for the randomSeed record component
      notificationPolicy - the value for the notificationPolicy record component
    • SimulatedAnnealingConfig

      public SimulatedAnnealingConfig(long maxSteps, long stepsPerTemperature, double alpha, double minTemperature, long progressEverySteps, long refreshEverySteps, long randomSeed)
      Convenience constructor using the default listener-delivery policy.
  • Method Details

    • defaults

      public static SimulatedAnnealingConfig defaults()
      Return a practical general-purpose configuration.
      Returns:
      default configuration
    • withProgressEverySteps

      public SimulatedAnnealingConfig withProgressEverySteps(long steps)
      Return a copy with a different progress notification interval.
      Parameters:
      steps - new non-negative interval; zero disables progress posts
      Returns:
      updated configuration
    • 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.
    • maxSteps

      public long maxSteps()
      Returns the value of the maxSteps record component.
      Returns:
      the value of the maxSteps record component
    • stepsPerTemperature

      public long stepsPerTemperature()
      Returns the value of the stepsPerTemperature record component.
      Returns:
      the value of the stepsPerTemperature record component
    • alpha

      public double alpha()
      Returns the value of the alpha record component.
      Returns:
      the value of the alpha record component
    • minTemperature

      public double minTemperature()
      Returns the value of the minTemperature record component.
      Returns:
      the value of the minTemperature record component
    • progressEverySteps

      public long progressEverySteps()
      Returns the value of the progressEverySteps record component.
      Returns:
      the value of the progressEverySteps record component
    • refreshEverySteps

      public long refreshEverySteps()
      Returns the value of the refreshEverySteps record component.
      Returns:
      the value of the refreshEverySteps record component
    • randomSeed

      public long randomSeed()
      Returns the value of the randomSeed record component.
      Returns:
      the value of the randomSeed record component
    • notificationPolicy

      public AnnealingNotificationPolicy notificationPolicy()
      Returns the value of the notificationPolicy record component.
      Returns:
      the value of the notificationPolicy record component