algorithms.acceptors
Class SchrimpfAcceptance

java.lang.Object
  extended by algorithms.acceptors.SchrimpfAcceptance
All Implemented Interfaces:
SolutionAcceptor, AlgorithmStartsListener, IterationStartsListener, VehicleRoutingAlgorithmListener

public class SchrimpfAcceptance
extends java.lang.Object
implements SolutionAcceptor, IterationStartsListener, AlgorithmStartsListener


Constructor Summary
SchrimpfAcceptance(int solutionMemory, double alpha, int nOfWarmupIterations)
           
 
Method Summary
 boolean acceptSolution(java.util.Collection<VehicleRoutingProblemSolution> solutions, VehicleRoutingProblemSolution newSolution)
          Accepts solution or not, and returns true if a new solution has been accepted.
 void informAlgorithmStarts(VehicleRoutingProblem problem, VehicleRoutingAlgorithm algorithm, java.util.Collection<VehicleRoutingProblemSolution> solutions)
           
 void informIterationStarts(int i, VehicleRoutingProblem problem, java.util.Collection<VehicleRoutingProblemSolution> solutions)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchrimpfAcceptance

public SchrimpfAcceptance(int solutionMemory,
                          double alpha,
                          int nOfWarmupIterations)
Method Detail

acceptSolution

public boolean acceptSolution(java.util.Collection<VehicleRoutingProblemSolution> solutions,
                              VehicleRoutingProblemSolution newSolution)
Description copied from interface: SolutionAcceptor
Accepts 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:
acceptSolution in interface SolutionAcceptor
Returns:
TODO

toString

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

informAlgorithmStarts

public void informAlgorithmStarts(VehicleRoutingProblem problem,
                                  VehicleRoutingAlgorithm algorithm,
                                  java.util.Collection<VehicleRoutingProblemSolution> solutions)
Specified by:
informAlgorithmStarts in interface AlgorithmStartsListener

informIterationStarts

public void informIterationStarts(int i,
                                  VehicleRoutingProblem problem,
                                  java.util.Collection<VehicleRoutingProblemSolution> solutions)
Specified by:
informIterationStarts in interface IterationStartsListener