Record Class SimulatedAnnealingState

java.lang.Object
java.lang.Record
edu.cnu.mdi.sim.simanneal.SimulatedAnnealingState
Record Components:
step - number of completed annealing iterations
temperature - absolute temperature used for the next iteration
currentEnergy - energy of the current solution
bestEnergy - lowest energy observed during the run
acceptedMoves - total number of accepted moves
uphillAcceptedMoves - 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 Details

    • SimulatedAnnealingState

      public SimulatedAnnealingState(long step, double temperature, double currentEnergy, double bestEnergy, long acceptedMoves, long uphillAcceptedMoves)
      Creates an instance of a SimulatedAnnealingState record class.
      Parameters:
      step - the value for the step record component
      temperature - the value for the temperature record component
      currentEnergy - the value for the currentEnergy record component
      bestEnergy - the value for the bestEnergy record component
      acceptedMoves - the value for the acceptedMoves record component
      uphillAcceptedMoves - the value for the uphillAcceptedMoves record component
  • Method Details

    • 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. All components in this record class 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.
    • step

      public long step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • temperature

      public double temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • currentEnergy

      public double currentEnergy()
      Returns the value of the currentEnergy record component.
      Returns:
      the value of the currentEnergy record component
    • bestEnergy

      public double bestEnergy()
      Returns the value of the bestEnergy record component.
      Returns:
      the value of the bestEnergy record component
    • acceptedMoves

      public long acceptedMoves()
      Returns the value of the acceptedMoves record component.
      Returns:
      the value of the acceptedMoves record component
    • uphillAcceptedMoves

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