public void addStopCriterion ( StopCriterion stopCriterion ) { // acquire status lock synchronized ( statusLock ) { // assert idle assertIdle ( "Cannot add stop criterion." ) ; // pass stop criterion to checker (throws error if incompatible) stopCriterionChecker . add ( stopCriterion ) ; // log LOGGER . debug ( "{}: added stop criterion {}" , this , stopCriterion ) ; } }
Adds a stop criterion used to decide when the search should stop running . It is verified whether the given stop criterion is compatible with the search and if not an exception is thrown . Note that this method can only be called when the search is idle .