algorithms.acceptors
Class AcceptNewRemoveFirst

java.lang.Object
  extended by algorithms.acceptors.AcceptNewRemoveFirst
All Implemented Interfaces:
SolutionAcceptor

public class AcceptNewRemoveFirst
extends java.lang.Object
implements SolutionAcceptor


Constructor Summary
AcceptNewRemoveFirst(int solutionMemory)
           
 
Method Summary
 boolean acceptSolution(java.util.Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution)
          Accepts every solution if solution memory allows.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AcceptNewRemoveFirst

public AcceptNewRemoveFirst(int solutionMemory)
Method Detail

acceptSolution

public boolean acceptSolution(java.util.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:
acceptSolution in interface SolutionAcceptor
Returns:
TODO

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object