Class RecordToRecordTravelAcceptance
java.lang.Object
com.graphhopper.jsprit.core.algorithm.acceptor.RecordToRecordTravelAcceptance
- All Implemented Interfaces:
SolutionAcceptor,AlgorithmStartsListener,IterationStartsListener,VehicleRoutingAlgorithmListener
public class RecordToRecordTravelAcceptance
extends Object
implements SolutionAcceptor, IterationStartsListener, AlgorithmStartsListener
- Author:
- schroeder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution) Accepts solution or not, and returns true if a new solution has been accepted.doubledoublevoidinformAlgorithmStarts(VehicleRoutingProblem problem, VehicleRoutingAlgorithm algorithm, Collection<VehicleRoutingProblemSolution> solutions) voidinformIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) voidsetEndThreshold(double endThreshold) voidsetInitialThreshold(double initialThreshold) Sets initial threshold.voidsetMaxIterations(int maxIteration) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.graphhopper.jsprit.core.algorithm.acceptor.SolutionAcceptor
getCurrentThreshold
-
Constructor Details
-
RecordToRecordTravelAcceptance
public RecordToRecordTravelAcceptance()
-
-
Method Details
-
acceptSolution
public boolean acceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution) Description copied from interface:SolutionAcceptorAccepts solution or not, and returns true if a new solution has been accepted.If the solution is accepted, it is added to solutions, i.e. the solutions-collections is modified.
- Specified by:
acceptSolutionin interfaceSolutionAcceptor- Parameters:
solutions- collection of existing solutionsnewSolution- new solution to be evaluated- Returns:
- true if solution accepted
-
toString
-
getInitialThreshold
public double getInitialThreshold() -
getEndThreshold
public double getEndThreshold() -
setInitialThreshold
public void setInitialThreshold(double initialThreshold) Sets initial threshold.Note that if initial threshold has been set, automatic generation of initial threshold is disabled.
- Parameters:
initialThreshold- the initialThreshold to set
-
setEndThreshold
public void setEndThreshold(double endThreshold) -
setMaxIterations
public void setMaxIterations(int maxIteration) -
informAlgorithmStarts
public void informAlgorithmStarts(VehicleRoutingProblem problem, VehicleRoutingAlgorithm algorithm, Collection<VehicleRoutingProblemSolution> solutions) - Specified by:
informAlgorithmStartsin interfaceAlgorithmStartsListener
-
informIterationStarts
public void informIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) - Specified by:
informIterationStartsin interfaceIterationStartsListener
-