Package edu.cnu.mdi.sim.simanneal
Record Class SimulatedAnnealingConfig
java.lang.Object
java.lang.Record
edu.cnu.mdi.sim.simanneal.SimulatedAnnealingConfig
- Record Components:
maxSteps- maximum number of iterations; must be positivestepsPerTemperature- iterations per schedule level, or zero to advance the schedule on every iterationalpha- geometric cooling factor in(0,1]minTemperature- non-negative absolute-temperature stopping thresholdprogressEverySteps- progress interval, or zero to disable progress postsrefreshEverySteps- refresh interval, or zero to disable refresh requestsrandomSeed- deterministic seed, or zero to choose a nondeterministic seednotificationPolicy- 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 Summary
ConstructorsConstructorDescriptionSimulatedAnnealingConfig(long maxSteps, long stepsPerTemperature, double alpha, double minTemperature, long progressEverySteps, long refreshEverySteps, long randomSeed) Convenience constructor using the default listener-delivery policy.SimulatedAnnealingConfig(long maxSteps, long stepsPerTemperature, double alpha, double minTemperature, long progressEverySteps, long refreshEverySteps, long randomSeed, AnnealingNotificationPolicy notificationPolicy) Creates an instance of aSimulatedAnnealingConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublealpha()Returns the value of thealpharecord component.static SimulatedAnnealingConfigdefaults()Return a practical general-purpose configuration.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longmaxSteps()Returns the value of themaxStepsrecord component.doubleReturns the value of theminTemperaturerecord component.Returns the value of thenotificationPolicyrecord component.longReturns the value of theprogressEveryStepsrecord component.longReturns the value of therandomSeedrecord component.longReturns the value of therefreshEveryStepsrecord component.longReturns the value of thestepsPerTemperaturerecord component.final StringtoString()Returns a string representation of this record class.withProgressEverySteps(long steps) Return a copy with a different progress notification interval.
-
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 aSimulatedAnnealingConfigrecord class.- Parameters:
maxSteps- the value for themaxStepsrecord componentstepsPerTemperature- the value for thestepsPerTemperaturerecord componentalpha- the value for thealpharecord componentminTemperature- the value for theminTemperaturerecord componentprogressEverySteps- the value for theprogressEveryStepsrecord componentrefreshEverySteps- the value for therefreshEveryStepsrecord componentrandomSeed- the value for therandomSeedrecord componentnotificationPolicy- the value for thenotificationPolicyrecord 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
Return a practical general-purpose configuration.- Returns:
- default configuration
-
withProgressEverySteps
Return a copy with a different progress notification interval.- Parameters:
steps- new non-negative interval; zero disables progress posts- Returns:
- updated configuration
-
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 '=='. -
maxSteps
public long maxSteps()Returns the value of themaxStepsrecord component.- Returns:
- the value of the
maxStepsrecord component
-
stepsPerTemperature
public long stepsPerTemperature()Returns the value of thestepsPerTemperaturerecord component.- Returns:
- the value of the
stepsPerTemperaturerecord component
-
alpha
public double alpha()Returns the value of thealpharecord component.- Returns:
- the value of the
alpharecord component
-
minTemperature
public double minTemperature()Returns the value of theminTemperaturerecord component.- Returns:
- the value of the
minTemperaturerecord component
-
progressEverySteps
public long progressEverySteps()Returns the value of theprogressEveryStepsrecord component.- Returns:
- the value of the
progressEveryStepsrecord component
-
refreshEverySteps
public long refreshEverySteps()Returns the value of therefreshEveryStepsrecord component.- Returns:
- the value of the
refreshEveryStepsrecord component
-
randomSeed
public long randomSeed()Returns the value of therandomSeedrecord component.- Returns:
- the value of the
randomSeedrecord component
-
notificationPolicy
Returns the value of thenotificationPolicyrecord component.- Returns:
- the value of the
notificationPolicyrecord component
-