Record Class ConstantInitialTemperature<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>

java.lang.Object
java.lang.Record
es.urjc.etsii.grafo.improve.sa.initialt.ConstantInitialTemperature<M,S,I>
Type Parameters:
M - Move type
S - Your solution class
I - Your instance class
All Implemented Interfaces:
InitialTemperatureCalculator<M,S,I>

public record ConstantInitialTemperature<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>(double initialTemperature) extends Record implements InitialTemperatureCalculator<M,S,I>
Constant initial temperature calculator.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConstantInitialTemperature(double initialTemperature)
    Creates an instance of a ConstantInitialTemperature record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    initial(S solution, Neighborhood<M,S,I> neighborhood)
    Determines initial simulated annealing temperature
    double
    Returns the value of the initialTemperature record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ConstantInitialTemperature

      public ConstantInitialTemperature(double initialTemperature)
      Creates an instance of a ConstantInitialTemperature record class.
      Parameters:
      initialTemperature - the value for the initialTemperature record component
  • Method Details

    • initial

      public double initial(S solution, Neighborhood<M,S,I> neighborhood)
      Description copied from interface: InitialTemperatureCalculator
      Determines initial simulated annealing temperature
      Specified by:
      initial in interface InitialTemperatureCalculator<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>
      Parameters:
      solution - Solution being solved
      neighborhood - Current neighborhood
      Returns:
      temperature as a double
    • 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.
    • initialTemperature

      public double initialTemperature()
      Returns the value of the initialTemperature record component.
      Returns:
      the value of the initialTemperature record component