Record Class AcceptanceDecision

java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.algorithm.listener.events.AcceptanceDecision
Record Components:
iteration - The iteration number
timestamp - When the event occurred
oldCost - The cost of the previous solution
newCost - The cost of the new solution
accepted - Whether the new solution was accepted
strategyId - The ID of the search strategy that produced this solution
isNewBest - Whether this is a new best solution overall
threshold - The acceptance threshold at this iteration (for Schrimpf acceptance)
oldCostBreakdown - Cost breakdown by component for the old solution (null if not available)
newCostBreakdown - Cost breakdown by component for the new solution (null if not available)
All Implemented Interfaces:
AlgorithmEvent

public record AcceptanceDecision(int iteration, long timestamp, double oldCost, double newCost, boolean accepted, String strategyId, boolean isNewBest, double threshold, Map<String,Double> oldCostBreakdown, Map<String,Double> newCostBreakdown) extends Record implements AlgorithmEvent
Event emitted when a solution acceptance decision is made.
  • Constructor Details

    • AcceptanceDecision

      public AcceptanceDecision(int iteration, long timestamp, double oldCost, double newCost, boolean accepted, String strategyId, boolean isNewBest, double threshold, Map<String,Double> oldCostBreakdown, Map<String,Double> newCostBreakdown)
      Creates an instance of a AcceptanceDecision record class.
      Parameters:
      iteration - the value for the iteration record component
      timestamp - the value for the timestamp record component
      oldCost - the value for the oldCost record component
      newCost - the value for the newCost record component
      accepted - the value for the accepted record component
      strategyId - the value for the strategyId record component
      isNewBest - the value for the isNewBest record component
      threshold - the value for the threshold record component
      oldCostBreakdown - the value for the oldCostBreakdown record component
      newCostBreakdown - the value for the newCostBreakdown 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. 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.
    • iteration

      public int iteration()
      Returns the value of the iteration record component.
      Specified by:
      iteration in interface AlgorithmEvent
      Returns:
      the value of the iteration record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Specified by:
      timestamp in interface AlgorithmEvent
      Returns:
      the value of the timestamp record component
    • oldCost

      public double oldCost()
      Returns the value of the oldCost record component.
      Returns:
      the value of the oldCost record component
    • newCost

      public double newCost()
      Returns the value of the newCost record component.
      Returns:
      the value of the newCost record component
    • accepted

      public boolean accepted()
      Returns the value of the accepted record component.
      Returns:
      the value of the accepted record component
    • strategyId

      public String strategyId()
      Returns the value of the strategyId record component.
      Returns:
      the value of the strategyId record component
    • isNewBest

      public boolean isNewBest()
      Returns the value of the isNewBest record component.
      Returns:
      the value of the isNewBest record component
    • threshold

      public double threshold()
      Returns the value of the threshold record component.
      Returns:
      the value of the threshold record component
    • oldCostBreakdown

      public Map<String,Double> oldCostBreakdown()
      Returns the value of the oldCostBreakdown record component.
      Returns:
      the value of the oldCostBreakdown record component
    • newCostBreakdown

      public Map<String,Double> newCostBreakdown()
      Returns the value of the newCostBreakdown record component.
      Returns:
      the value of the newCostBreakdown record component