public class GreedyAcceptance extends Object implements SolutionAcceptor
If there is enough memory, every solution will be accepted. If there is no memory anymore and the solution to be evaluated is better than the worst, the worst will be replaced by the new solution.
| Constructor and Description |
|---|
GreedyAcceptance(int solutionMemory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptSolution(Collection<VehicleRoutingProblemSolution> solutions,
VehicleRoutingProblemSolution newSolution)
Accepts every solution if solution memory allows.
|
String |
toString() |
public boolean acceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution)
Note that this modifies Collection
acceptSolution in interface SolutionAcceptorsolutions - collection of existing solutionsnewSolution - new solution to be evaluatedCopyright © 2013–2024. All rights reserved.