public class MaxRuntime extends Object implements StopCriterion
Constructor and Description |
---|
MaxRuntime(long maxRuntime,
TimeUnit timeUnit)
Create a stop criterion to limit the runtime of a search run.
|
Modifier and Type | Method and Description |
---|---|
boolean |
searchShouldStop(Search<?> search)
Checks whether the maximum runtime has been reached for the given search.
|
String |
toString() |
public MaxRuntime(long maxRuntime, TimeUnit timeUnit)
maxRuntime
- maximum runtimetimeUnit
- corresponding time unitIllegalArgumentException
- if a runtime lower than 1 millisecond is givenpublic boolean searchShouldStop(Search<?> search)
searchShouldStop
in interface StopCriterion
search
- search for which the runtime has to be checkedtrue
if the given search has reached the maximum runtimeCopyright © 2016. All rights reserved.