Пример #1
0
 forceinline
 RBS<E,T>::RBS(T* s, const Search::Options& m_opt) {
   if (m_opt.cutoff == NULL)
     throw Search::UninitializedCutoff("RBS::RBS");
   Search::Options e_opt(m_opt.expand());
   e_opt.clone = false;
   Search::Meta::RestartStop* rs = new Search::Meta::RestartStop(m_opt.stop);
   e_opt.stop = rs;
   Space* master;
   Space* slave;
   if (s->status(rs->m_stat) == SS_FAILED) {
     rs->m_stat.fail++;
     master = NULL;
     slave  = NULL;
   } else {
     if (m_opt.clone)
       master = s->clone();
     else
       master = s;
     slave = master->clone();
     CRI cri(0,0,0,NULL,NoGoods::eng);
     slave->slave(cri);
   }
   E<T> engine(dynamic_cast<T*>(slave),e_opt);
   Search::EngineBase<T>* eb = &engine;
   Search::Engine* ee = eb->e;
   eb->e = NULL;
   e = new Search::Meta::RBS(master,rs,ee,m_opt);
 }
Пример #2
0
 forceinline
 RBS<E,T>::RBS(T* s, const Search::Options& m_opt) {
   if (m_opt.cutoff == NULL)
     throw Search::UninitializedCutoff("RBS::RBS");
   Search::Options e_opt(m_opt);
   e_opt.clone = true;
   Search::MetaStop* ms = new Search::MetaStop(m_opt.stop);
   e_opt.stop = ms;
   Space* master;
   if (m_opt.clone) {
     if (s->status(ms->m_stat) == SS_FAILED) {
       ms->m_stat.fail++;
       master = NULL;
     } else {
       master = s->clone();
     }
   } else {
     master = s;
   }
   E<T> engine(dynamic_cast<T*>(master),e_opt);
   EngineBase* eb = &engine;
   Search::Engine* ee = eb->e;
   eb->e = NULL;
   e = Search::rbs(master,ms,ee,m_opt);
 }