Package edu.cnu.mdi.sim.simanneal
Record Class SimulatedAnnealingState
java.lang.Object
java.lang.Record
edu.cnu.mdi.sim.simanneal.SimulatedAnnealingState
- Record Components:
step- number of completed annealing iterationstemperature- absolute temperature used for the next iterationcurrentEnergy- energy of the current solutionbestEnergy- lowest energy observed during the runacceptedMoves- total number of accepted movesuphillAcceptedMoves- number of accepted moves that increased energy
public record SimulatedAnnealingState(long step, double temperature, double currentEnergy, double bestEnergy, long acceptedMoves, long uphillAcceptedMoves)
extends Record
Immutable state snapshot of a simulated annealing process.
-
Constructor Summary
ConstructorsConstructorDescriptionSimulatedAnnealingState(long step, double temperature, double currentEnergy, double bestEnergy, long acceptedMoves, long uphillAcceptedMoves) Creates an instance of aSimulatedAnnealingStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theacceptedMovesrecord component.doubleReturns the value of thebestEnergyrecord component.doubleReturns the value of thecurrentEnergyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longstep()Returns the value of thesteprecord component.doubleReturns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theuphillAcceptedMovesrecord component.
-
Constructor Details
-
SimulatedAnnealingState
public SimulatedAnnealingState(long step, double temperature, double currentEnergy, double bestEnergy, long acceptedMoves, long uphillAcceptedMoves) Creates an instance of aSimulatedAnnealingStaterecord class.- Parameters:
step- the value for thesteprecord componenttemperature- the value for thetemperaturerecord componentcurrentEnergy- the value for thecurrentEnergyrecord componentbestEnergy- the value for thebestEnergyrecord componentacceptedMoves- the value for theacceptedMovesrecord componentuphillAcceptedMoves- the value for theuphillAcceptedMovesrecord component
-
-
Method Details
-
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. All components in this record class are compared with '=='. -
step
public long step()Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-
temperature
public double temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
currentEnergy
public double currentEnergy()Returns the value of thecurrentEnergyrecord component.- Returns:
- the value of the
currentEnergyrecord component
-
bestEnergy
public double bestEnergy()Returns the value of thebestEnergyrecord component.- Returns:
- the value of the
bestEnergyrecord component
-
acceptedMoves
public long acceptedMoves()Returns the value of theacceptedMovesrecord component.- Returns:
- the value of the
acceptedMovesrecord component
-
uphillAcceptedMoves
public long uphillAcceptedMoves()Returns the value of theuphillAcceptedMovesrecord component.- Returns:
- the value of the
uphillAcceptedMovesrecord component
-