Exemple #1
0
 /// Report reason why search has been stopped
 int reason(const Search::Statistics& s, const Search::Options& o) {
   return 
     (((ns != NULL) && ns->stop(s,o)) ? SR_NODE : 0) |
     (((fs != NULL) && fs->stop(s,o)) ? SR_FAIL : 0) |
     (((ts != NULL) && ts->stop(s,o)) ? SR_TIME : 0) |
     (sigint                          ? SR_INT  : 0);
 }
Exemple #2
0
 /// Test whether search must be stopped
 virtual bool stop(const Search::Statistics& s, const Search::Options& o) {
   return
     sigint ||
     ((ns != NULL) && ns->stop(s,o)) ||
     ((fs != NULL) && fs->stop(s,o)) ||
     ((ts != NULL) && ts->stop(s,o));
 }
Exemple #3
0
    /// Test whether search must be stopped
    virtual bool stop(const Search::Statistics& s, const Search::Options& o) {
	bool stopping;
	stopping =
	    ((ns != NULL) && ns->stop(s,o)) ||
	    ((fs != NULL) && fs->stop(s,o)) ||
	    ((ts != NULL) && ts->stop(s,o)) ||
	    ((ms != NULL) && ms->stop(s,o));
	if (stopping) {
	    this->stop_reason =
		(((ns != NULL) && ns->stop(s,o)) ? SR_NODE : 0) |
		(((fs != NULL) && fs->stop(s,o)) ? SR_FAIL : 0) |
		(((ts != NULL) && ts->stop(s,o)) ? SR_TIME : 0) |
		(((ms != NULL) && ms->stop(s,o)) ? SR_MEM  : 0);
	}
	return stopping;
    }
Exemple #4
0
    /// Reset (currently only for timer)
    void reset(void) {
	if (ts != NULL) ts->reset();
    }