| 316 | template<class Script, template<class> class Engine, class Options, |
| 317 | template<class, template<class> class> class Meta> |
| 318 | void |
| 319 | ScriptBase<BaseSpace>::runMeta(const Options& o, Script* s) { |
| 320 | using namespace std; |
| 321 | |
| 322 | ofstream sol_file, log_file; |
| 323 | |
| 324 | ostream& s_out = select_ostream(o.out_file(), sol_file); |
| 325 | ostream& l_out = select_ostream(o.log_file(), log_file); |
| 326 | |
| 327 | Search::Options so; |
| 328 | |
| 329 | try { |
| 330 | switch (o.mode()) { |
| 331 | case SM_GIST: |
| 332 | #ifdef GECODE_HAS_GIST |
| 333 | { |
| 334 | Gist::Print<Script> pi(o.name()); |
| 335 | Gist::VarComparator<Script> vc(o.name()); |
| 336 | Gist::Options opt; |
| 337 | opt.inspect.click(&pi); |
| 338 | opt.inspect.compare(&vc); |
| 339 | opt.clone = false; |
| 340 | opt.c_d = o.c_d(); |
| 341 | opt.a_d = o.a_d(); |
| 342 | for (unsigned int i=0; o.inspect.click(i) != nullptr; i++) |
| 343 | opt.inspect.click(o.inspect.click(i)); |
| 344 | for (unsigned int i=0; o.inspect.solution(i) != nullptr; i++) |
| 345 | opt.inspect.solution(o.inspect.solution(i)); |
| 346 | for (unsigned int i=0; o.inspect.move(i) != nullptr; i++) |
| 347 | opt.inspect.move(o.inspect.move(i)); |
| 348 | for (unsigned int i=0; o.inspect.compare(i) != nullptr; i++) |
| 349 | opt.inspect.compare(o.inspect.compare(i)); |
| 350 | if (s == nullptr) |
| 351 | s = new Script(o); |
| 352 | (void) GistEngine<Engine<Script> >::explore(s, opt); |
| 353 | } |
| 354 | break; |
| 355 | // If Gist is not available, goto solution |
| 356 | #else |
| 357 | goto solution; |
| 358 | #endif |
| 359 | case SM_SOLUTION: |
| 360 | #ifndef GECODE_HAS_GIST |
| 361 | solution: |
| 362 | #endif |
| 363 | { |
| 364 | #ifdef GECODE_HAS_CPPROFILER |
| 365 | if (o.profiler_port()) { |
| 366 | CPProfilerSearchTracer::GetInfo* getInfo = nullptr; |
| 367 | getInfo = new ScriptGetInfo<BaseSpace>; |
| 368 | so.tracer = new CPProfilerSearchTracer |
| 369 | (o.profiler_id(), o.name(), o.profiler_port(), getInfo); |
| 370 | } |
| 371 | #endif |
| 372 | l_out << o.name() << endl; |
| 373 | Support::Timer t; |
| 374 | unsigned long long int s_l = |
| 375 | (o.solutions() == 0) ? ULLONG_MAX : o.solutions(); |
nothing calls this directly
no test coverage detected