Class AcceptNewRemoveFirst
java.lang.Object
com.graphhopper.jsprit.core.algorithm.acceptor.AcceptNewRemoveFirst
- All Implemented Interfaces:
SolutionAcceptor
Created by schroeder on 09/02/16.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution) Accepts every solution if solution memory allows.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
-
AcceptNewRemoveFirst
public AcceptNewRemoveFirst(int solutionMemory)
-
-
Method Details
-
acceptSolution
public boolean acceptSolution(Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution) Accepts every solution if solution memory allows. If memory occupied, than accepts new solution only if better than the worst in memory. Consequently, the worst solution is removed from solutions, and the new solution added.Note that this modifies Collection
solutions. - Specified by:
acceptSolutionin interfaceSolutionAcceptor- Parameters:
solutions- collection of existing solutionsnewSolution- new solution to be evaluated- Returns:
- true if solution accepted
-
toString
-