1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

some internals

This commit is contained in:
Stefan Schroeder 2013-11-07 16:47:27 +01:00
parent 59f0f63e19
commit c31949f538

View file

@ -28,6 +28,16 @@ import basics.VehicleRoutingProblem;
import basics.VehicleRoutingProblemSolution;
import basics.algo.SearchStrategy.DiscoveredSolution;
/**
* Breaks algorithm prematurely based on variationCoefficient.
*
* <p>Note that this must be registered in algorithm<br>
* <code>algorithm.getAlgorithmListeners().addListener(this);</code>
*
*
* @author stefan
*
*/
public class VariationCoefficientBreaker implements PrematureAlgorithmBreaker, IterationStartsListener, AlgorithmStartsListener, IterationEndsListener{
private static Logger logger = Logger.getLogger(VariationCoefficientBreaker.class);
@ -42,6 +52,16 @@ public class VariationCoefficientBreaker implements PrematureAlgorithmBreaker, I
private VehicleRoutingProblemSolution lastAccepted = null;
/**
* Breaks algorithm prematurely based on variationCoefficient.
*
* <p>Note that this must be registered in algorithm<br>
* <code>algorithm.getAlgorithmListeners().addListener(this);</code>
*
*
* @author stefan
*
*/
public VariationCoefficientBreaker(int nuOfIterations, double variationCoefficientThreshold) {
super();
this.nuOfIterations = nuOfIterations;