mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
some internals
This commit is contained in:
parent
59f0f63e19
commit
c31949f538
1 changed files with 20 additions and 0 deletions
|
|
@ -28,6 +28,16 @@ import basics.VehicleRoutingProblem;
|
||||||
import basics.VehicleRoutingProblemSolution;
|
import basics.VehicleRoutingProblemSolution;
|
||||||
import basics.algo.SearchStrategy.DiscoveredSolution;
|
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{
|
public class VariationCoefficientBreaker implements PrematureAlgorithmBreaker, IterationStartsListener, AlgorithmStartsListener, IterationEndsListener{
|
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(VariationCoefficientBreaker.class);
|
private static Logger logger = Logger.getLogger(VariationCoefficientBreaker.class);
|
||||||
|
|
@ -42,6 +52,16 @@ public class VariationCoefficientBreaker implements PrematureAlgorithmBreaker, I
|
||||||
|
|
||||||
private VehicleRoutingProblemSolution lastAccepted = null;
|
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) {
|
public VariationCoefficientBreaker(int nuOfIterations, double variationCoefficientThreshold) {
|
||||||
super();
|
super();
|
||||||
this.nuOfIterations = nuOfIterations;
|
this.nuOfIterations = nuOfIterations;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue