public class RecordToRecordTravelAcceptance extends Object implements SolutionAcceptor, IterationStartsListener, AlgorithmStartsListener
| Constructor and Description |
|---|
RecordToRecordTravelAcceptance() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptSolution(Collection<VehicleRoutingProblemSolution> solutions,
VehicleRoutingProblemSolution newSolution)
Accepts solution or not, and returns true if a new solution has been accepted.
|
double |
getEndThreshold() |
double |
getInitialThreshold() |
void |
informAlgorithmStarts(VehicleRoutingProblem problem,
VehicleRoutingAlgorithm algorithm,
Collection<VehicleRoutingProblemSolution> solutions) |
void |
informIterationStarts(int i,
VehicleRoutingProblem problem,
Collection<VehicleRoutingProblemSolution> solutions) |
void |
setEndThreshold(double endThreshold) |
void |
setInitialThreshold(double initialThreshold)
Sets initial threshold.
|
void |
setMaxIterations(int maxIteration) |
String |
toString() |
public boolean acceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution)
SolutionAcceptor
If the solution is accepted, it is added to solutions, i.e. the solutions-collections is modified.
acceptSolution in interface SolutionAcceptorsolutions - collection of existing solutionsnewSolution - new solution to be evaluatedpublic double getInitialThreshold()
public double getEndThreshold()
public void setInitialThreshold(double initialThreshold)
Note that if initial threshold has been set, automatic generation of initial threshold is disabled.
initialThreshold - the initialThreshold to setpublic void setEndThreshold(double endThreshold)
public void setMaxIterations(int maxIteration)
public void informAlgorithmStarts(VehicleRoutingProblem problem, VehicleRoutingAlgorithm algorithm, Collection<VehicleRoutingProblemSolution> solutions)
informAlgorithmStarts in interface AlgorithmStartsListenerpublic void informIterationStarts(int i,
VehicleRoutingProblem problem,
Collection<VehicleRoutingProblemSolution> solutions)
informIterationStarts in interface IterationStartsListenerCopyright © 2013–2024. All rights reserved.