Record Class AcceptanceDecision
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.algorithm.listener.events.AcceptanceDecision
- Record Components:
iteration- The iteration numbertimestamp- When the event occurredoldCost- The cost of the previous solutionnewCost- The cost of the new solutionaccepted- Whether the new solution was acceptedstrategyId- The ID of the search strategy that produced this solutionisNewBest- Whether this is a new best solution overallthreshold- 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 Summary
ConstructorsConstructorDescriptionAcceptanceDecision(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 aAcceptanceDecisionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Returns the value of theacceptedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisNewBestrecord component.intReturns the value of theiterationrecord component.doublenewCost()Returns the value of thenewCostrecord component.Returns the value of thenewCostBreakdownrecord component.doubleoldCost()Returns the value of theoldCostrecord component.Returns the value of theoldCostBreakdownrecord component.Returns the value of thestrategyIdrecord component.doubleReturns the value of thethresholdrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
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 aAcceptanceDecisionrecord class.- Parameters:
iteration- the value for theiterationrecord componenttimestamp- the value for thetimestamprecord componentoldCost- the value for theoldCostrecord componentnewCost- the value for thenewCostrecord componentaccepted- the value for theacceptedrecord componentstrategyId- the value for thestrategyIdrecord componentisNewBest- the value for theisNewBestrecord componentthreshold- the value for thethresholdrecord componentoldCostBreakdown- the value for theoldCostBreakdownrecord componentnewCostBreakdown- the value for thenewCostBreakdownrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
iteration
public int iteration()Returns the value of theiterationrecord component.- Specified by:
iterationin interfaceAlgorithmEvent- Returns:
- the value of the
iterationrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceAlgorithmEvent- Returns:
- the value of the
timestamprecord component
-
oldCost
public double oldCost()Returns the value of theoldCostrecord component.- Returns:
- the value of the
oldCostrecord component
-
newCost
public double newCost()Returns the value of thenewCostrecord component.- Returns:
- the value of the
newCostrecord component
-
accepted
public boolean accepted()Returns the value of theacceptedrecord component.- Returns:
- the value of the
acceptedrecord component
-
strategyId
Returns the value of thestrategyIdrecord component.- Returns:
- the value of the
strategyIdrecord component
-
isNewBest
public boolean isNewBest()Returns the value of theisNewBestrecord component.- Returns:
- the value of the
isNewBestrecord component
-
threshold
public double threshold()Returns the value of thethresholdrecord component.- Returns:
- the value of the
thresholdrecord component
-
oldCostBreakdown
Returns the value of theoldCostBreakdownrecord component.- Returns:
- the value of the
oldCostBreakdownrecord component
-
newCostBreakdown
Returns the value of thenewCostBreakdownrecord component.- Returns:
- the value of the
newCostBreakdownrecord component
-