mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
change para-name in constructor to specify time
This commit is contained in:
parent
96d7b6f9c3
commit
59f0f63e19
1 changed files with 20 additions and 2 deletions
|
|
@ -25,6 +25,15 @@ import basics.VehicleRoutingProblem;
|
|||
import basics.VehicleRoutingProblemSolution;
|
||||
import basics.algo.SearchStrategy.DiscoveredSolution;
|
||||
|
||||
/**
|
||||
* Breaks algorithm prematurely based on specified time.
|
||||
*
|
||||
* <p>Note, TimeBreaker must be registered as AlgorithmListener <br>
|
||||
* <code>agorithm.getAlgorithmListeners().addListener(this);</code>
|
||||
*
|
||||
* @author stefan
|
||||
*
|
||||
*/
|
||||
public class TimeBreaker implements PrematureAlgorithmBreaker, AlgorithmStartsListener{
|
||||
|
||||
private static Logger logger = Logger.getLogger(TimeBreaker.class);
|
||||
|
|
@ -33,9 +42,18 @@ public class TimeBreaker implements PrematureAlgorithmBreaker, AlgorithmStartsLi
|
|||
|
||||
private double startTime;
|
||||
|
||||
public TimeBreaker(double time) {
|
||||
/**
|
||||
* Constructs TimeBreaker that breaks algorithm prematurely based on specified time.
|
||||
*
|
||||
* <p>Note, TimeBreaker must be registered as AlgorithmListener <br>
|
||||
* <code>agorithm.getAlgorithmListeners().addListener(this);</code>
|
||||
*
|
||||
* @author stefan
|
||||
*
|
||||
*/
|
||||
public TimeBreaker(double time_in_seconds) {
|
||||
super();
|
||||
this.timeThreshold = time;
|
||||
this.timeThreshold = time_in_seconds;
|
||||
logger.info("initialise " + this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue