Generated on for Gecode by doxygen 1.17.0
script.hpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christian Schulte <schulte@gecode.dev>
5 *
6 * Copyright:
7 * Christian Schulte, 2004
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.dev
12 *
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining
15 * a copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sublicense, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be
23 * included in all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 *
33 */
34
35#include <iostream>
36#include <iomanip>
37#include <fstream>
38#include <cstring>
39
40#ifndef GECODE_THREADS_WINDOWS
41#include <csignal>
42#endif
43
44namespace Gecode { namespace Driver {
45
50 class CombinedStop : public Search::Stop {
51 private:
57 static bool sigint;
59 CombinedStop(unsigned long long int node,
60 unsigned long long int fail,
61 double time,
62 unsigned long long int restart)
63 : ns((node > 0ULL) ? new Search::NodeStop(node) : nullptr),
64 fs((fail > 0ULL) ? new Search::FailStop(fail) : nullptr),
65 ts((time > 0.0) ? new Search::TimeStop(time) : nullptr),
66 rs((restart > 0.0) ? new Search::RestartStop(restart) : nullptr) {
67 sigint = false;
68 }
69 public:
71 enum {
72 SR_NODE = 1 << 0,
73 SR_FAIL = 1 << 1,
74 SR_TIME = 1 << 2,
75 SR_RESTART = 1 << 3,
76 SR_INT = 1 << 4
77 };
79 virtual bool stop(const Search::Statistics& s, const Search::Options& o) {
80 return
81 sigint ||
82 ((ns != nullptr) && ns->stop(s,o)) ||
83 ((fs != nullptr) && fs->stop(s,o)) ||
84 ((ts != nullptr) && ts->stop(s,o)) ||
85 ((rs != nullptr) && rs->stop(s,o));
86 }
87
88 int reason(const Search::Statistics& s, const Search::Options& o) {
89 return
90 (((ns != nullptr) && ns->stop(s,o)) ? SR_NODE : 0) |
91 (((fs != nullptr) && fs->stop(s,o)) ? SR_FAIL : 0) |
92 (((ts != nullptr) && ts->stop(s,o)) ? SR_TIME : 0) |
93 (((rs != nullptr) && rs->stop(s,o)) ? SR_RESTART : 0) |
94 (sigint ? SR_INT : 0);
95 }
96
97 static Search::Stop*
98 create(unsigned long long int node,
99 unsigned long long int fail,
100 double time,
101 unsigned long long int restart,
102 bool intr) {
103 if (!intr && (node == 0ULL) && (fail == 0ULL) && (time == 0.0) && (restart == 0ULL))
104 return nullptr;
105 else
106 return new CombinedStop(node,fail,time,restart);
107 }
108#ifdef GECODE_THREADS_WINDOWS
110 static BOOL interrupt(DWORD t) noexcept {
111 if (t == CTRL_C_EVENT) {
112 sigint = true;
113 installCtrlHandler(false,true);
114 return true;
115 }
116 return false;
117 }
118#else
120 static void
122 sigint = true;
123 installCtrlHandler(false,true);
124 }
125#endif
127 static void installCtrlHandler(bool install, bool force=false) {
128 if (force || !sigint) {
129#ifdef GECODE_THREADS_WINDOWS
130 SetConsoleCtrlHandler( (PHANDLER_ROUTINE) interrupt, install);
131#else
132 std::signal(SIGINT, install ? interrupt : SIG_DFL);
133#endif
134 }
135 }
136
138 delete ns; delete fs; delete ts; delete rs;
139 }
140 };
141
147 stop(Support::Timer& t, std::ostream& os);
148
153 am(double t[], unsigned int n);
154
159 dev(double t[], unsigned int n);
160
162 template<class Options>
163 inline Search::Cutoff*
165 switch (o.restart()) {
166 case RM_NONE:
167 return nullptr;
168 case RM_CONSTANT:
170 case RM_LINEAR:
172 case RM_LUBY:
174 case RM_GEOMETRIC:
176 default: GECODE_NEVER;
177 }
178 return nullptr;
179 }
180
181
182#ifdef GECODE_HAS_GIST
183
187 template<class Engine>
189 public:
190 static void explore(Space* root, const Gist::Options& opt) {
191 (void) Gist::dfs(root, opt);
192 }
193 };
194
196 template<typename S>
197 class GistEngine<DFS<S> > {
198 public:
199 static void explore(S* root, const Gist::Options& opt) {
200 (void) Gist::dfs(root, opt);
201 }
202 };
203
205 template<typename S>
206 class GistEngine<LDS<S> > {
207 public:
208 static void explore(S* root, const Gist::Options& opt) {
209 (void) Gist::dfs(root, opt);
210 }
211 };
212
214 template<typename S>
215 class GistEngine<BAB<S> > {
216 public:
217 static void explore(S* root, const Gist::Options& opt) {
218 (void) Gist::bab(root, opt);
219 }
220 };
221
222#endif
223
224#ifdef GECODE_HAS_CPPROFILER
225
227 template<class BaseSpace>
229 public:
231 ScriptGetInfo(void);
233 virtual std::string getInfo(const Space& home) const;
234 };
235
236#endif
237
238 template<class BaseSpace>
241 : BaseSpace(opt) {}
242
243 template<class BaseSpace>
247
248 template<class BaseSpace>
249 void
250 ScriptBase<BaseSpace>::print(std::ostream&) const {}
251
252 template<class BaseSpace>
253 void
254 ScriptBase<BaseSpace>::compare(const Space&, std::ostream&) const {}
255
256 template<class BaseSpace>
257 std::ostream&
258 ScriptBase<BaseSpace>::select_ostream(const char* sn, std::ofstream& ofs) {
259 if (strcmp(sn, "stdout") == 0) {
260 return std::cout;
261 } else if (strcmp(sn, "stdlog") == 0) {
262 return std::clog;
263 } else if (strcmp(sn, "stderr") == 0) {
264 return std::cerr;
265 } else {
266 ofs.open(sn);
267 return ofs;
268 }
269 }
270
271#ifdef GECODE_HAS_CPPROFILER
272
273 template<class BaseSpace>
275
276 template<class BaseSpace>
277 std::string
279 std::stringstream ss;
280 if (const ScriptBase<BaseSpace>* sb
281 = dynamic_cast<const ScriptBase<BaseSpace>*>(&home))
282 sb->print(ss);
283 return ss.str();
284 }
285
286#endif
287
288
292 template<class T, template<class> class E>
293 class EngineToMeta : public E<T> {
294 public:
295 EngineToMeta(T* s, const Search::Options& o) : E<T>(s,o) {}
296 };
297
298 template<class BaseSpace>
299 template<class Script, template<class> class Engine, class Options>
300 void
302 if ((o.restart() != RM_NONE) && (o.assets() > 0)) {
303 std::cerr << "Cannot use restarts and portfolio..." << std::endl;
304 exit(EXIT_FAILURE);
305 }
306 if (o.restart() != RM_NONE) {
307 runMeta<Script,Engine,Options,RBS>(o,s);
308 } else if (o.assets() > 0) {
309 runMeta<Script,Engine,Options,PBS>(o,s);
310 } else {
311 runMeta<Script,Engine,Options,EngineToMeta>(o,s);
312 }
313 }
314
315 template<class BaseSpace>
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
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>;
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();
376 unsigned long long int s_n = 0;
377 t.start();
378 if (s == nullptr)
379 s = new Script(o);
380 unsigned int n_p = PropagatorGroup::all.size(*s);
381 unsigned int n_b = BrancherGroup::all.size(*s);
382 so.threads = o.threads();
383 so.c_d = o.c_d();
384 so.a_d = o.a_d();
385 so.d_l = o.d_l();
386 so.assets = o.assets();
387 so.slice = o.slice();
388 so.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
389 o.interrupt());
390 so.cutoff = createCutoff(o);
391#ifdef GECODE_HAS_EXPERIMENTAL
392 so.guidance = o.guidance();
393#endif
394 so.clone = false;
395 so.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
396 if (o.interrupt())
397 CombinedStop::installCtrlHandler(true);
398 {
399 Meta<Script,Engine> e(s,so);
400 if (o.print_last()) {
401 Script* px = nullptr;
402 do {
403 Script* ex = e.next();
404 if (ex == nullptr) {
405 if (px != nullptr) {
406 px->print(s_out);
407 delete px;
408 }
409 break;
410 } else {
411 s_n++;
412 delete px;
413 px = ex;
414 }
415 } while (s_n < s_l);
416 } else {
417 do {
418 Script* ex = e.next();
419 if (ex == nullptr)
420 break;
421 ex->print(s_out);
422 delete ex;
423 s_n++;
424 } while (s_n < s_l);
425 }
426 if (o.interrupt())
427 CombinedStop::installCtrlHandler(false);
428 Search::Statistics stat = e.statistics();
429 s_out << endl;
430 if (e.stopped()) {
431 l_out << "Search engine stopped..." << endl
432 << "\treason: ";
433 int r = static_cast<CombinedStop*>(so.stop)->reason(stat,so);
434 if (r & CombinedStop::SR_INT)
435 l_out << "user interrupt " << endl;
436 else {
437 if (r & CombinedStop::SR_NODE)
438 l_out << "node ";
439 if (r & CombinedStop::SR_FAIL)
440 l_out << "fail ";
441 if (r & CombinedStop::SR_TIME)
442 l_out << "time ";
443 if (r & CombinedStop::SR_RESTART)
444 l_out << "restart ";
445 l_out << "limit reached" << endl << endl;
446 }
447 }
448 l_out << "Initial" << endl
449 << "\tpropagators: " << n_p << endl
450 << "\tbranchers: " << n_b << endl
451 << endl
452 << "Summary" << endl
453 << "\truntime: ";
454 stop(t, l_out);
455 l_out << endl
456 << "\tsolutions: " << s_n << endl
457 << "\tpropagations: " << stat.propagate << endl
458 << "\tnodes: " << stat.node << endl
459 << "\tfailures: " << stat.fail << endl
460 << "\trestarts: " << stat.restart << endl
461 << "\tno-goods: " << stat.nogood << endl
462 << "\tpeak depth: " << stat.depth << endl
463#ifdef GECODE_PEAKHEAP
464 << "\tpeak memory: "
465 << static_cast<int>((heap.peak()+1023) / 1024) << " KB"
466 << endl
467#endif
468 << endl;
469 }
470 delete so.stop;
471 delete so.tracer;
472 }
473 break;
474 case SM_STAT:
475 {
476 l_out << o.name() << endl;
477 Support::Timer t;
478 unsigned long long int s_l =
479 (o.solutions() == 0) ? ULLONG_MAX : o.solutions();
480 unsigned long long int s_n = 0;
481 t.start();
482 if (s == nullptr)
483 s = new Script(o);
484 unsigned int n_p = PropagatorGroup::all.size(*s);
485 unsigned int n_b = BrancherGroup::all.size(*s);
486
487 so.clone = false;
488 so.threads = o.threads();
489 so.assets = o.assets();
490 so.slice = o.slice();
491 so.c_d = o.c_d();
492 so.a_d = o.a_d();
493 so.d_l = o.d_l();
494 so.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
495 o.interrupt());
496 so.cutoff = createCutoff(o);
497#ifdef GECODE_HAS_EXPERIMENTAL
498 so.guidance = o.guidance();
499#endif
500 so.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
501 if (o.interrupt())
502 CombinedStop::installCtrlHandler(true);
503 {
504 Meta<Script,Engine> e(s,so);
505 do {
506 Script* ex = e.next();
507 if (ex == nullptr)
508 break;
509 delete ex;
510 s_n++;
511 } while (s_n < s_l);
512 if (o.interrupt())
513 CombinedStop::installCtrlHandler(false);
514 Search::Statistics stat = e.statistics();
515 l_out << endl
516 << "\tpropagators: " << n_p << endl
517 << "\tbranchers: " << n_b << endl
518 << "\truntime: ";
519 stop(t, l_out);
520 l_out << endl
521 << "\tsolutions: " << s_n << endl
522 << "\tpropagations: " << stat.propagate << endl
523 << "\tnodes: " << stat.node << endl
524 << "\tfailures: " << stat.fail << endl
525 << "\trestarts: " << stat.restart << endl
526 << "\tno-goods: " << stat.nogood << endl
527 << "\tpeak depth: " << stat.depth << endl
528#ifdef GECODE_PEAKHEAP
529 << "\tpeak memory: "
530 << static_cast<int>((heap.peak()+1023) / 1024) << " KB"
531 << endl
532#endif
533 << endl;
534 }
535 delete so.stop;
536 }
537 break;
538 case SM_TIME:
539 {
540 l_out << o.name() << endl;
541 Support::Timer t;
542 double* ts = new double[o.samples()];
543 bool stopped = false;
544 for (unsigned int ns = o.samples(); !stopped && ns--; ) {
545 unsigned long long int s_l =
546 (o.solutions() == 0) ? ULLONG_MAX : o.solutions();
547 t.start();
548 for (unsigned int k = o.iterations(); !stopped && k--; ) {
549 unsigned long long int s_n = 0;
550 Script* s1 = new Script(o);
551 Search::Options sok;
552 sok.clone = false;
553 sok.threads = o.threads();
554 sok.assets = o.assets();
555 sok.slice = o.slice();
556 sok.c_d = o.c_d();
557 sok.a_d = o.a_d();
558 sok.d_l = o.d_l();
559 sok.stop = CombinedStop::create(o.node(),o.fail(), o.time(), o.restart_limit(),
560 false);
561 sok.cutoff = createCutoff(o);
562#ifdef GECODE_HAS_EXPERIMENTAL
563 sok.guidance = o.guidance();
564#endif
565 sok.nogoods_limit = o.nogoods() ? o.nogoods_limit() : 0U;
566 {
567 Meta<Script,Engine> e(s1,sok);
568 do {
569 Script* ex = e.next();
570 if (ex == nullptr)
571 break;
572 delete ex;
573 s_n++;
574 } while (s_n < s_l);
575 if (e.stopped())
576 stopped = true;
577 }
578 delete sok.stop;
579 }
580 ts[ns] = t.stop() / o.iterations();
581 }
582 if (stopped) {
583 l_out << "\tSTOPPED" << endl;
584 } else {
585 double m = am(ts,o.samples());
586 double d = dev(ts,o.samples()) * 100.0;
587 l_out << "\truntime: "
588 << setw(20) << right
589 << showpoint << fixed
590 << setprecision(6) << m << "ms"
591 << setprecision(2) << " (" << d << "% deviation)"
592 << endl;
593 }
594 delete [] ts;
595 }
596 break;
597 }
598 } catch (Exception& e) {
599 cerr << "Exception: " << e.what() << "." << endl
600 << "Stopping..." << endl;
601 if (sol_file.is_open())
602 sol_file.close();
603 if (log_file.is_open())
604 log_file.close();
605 exit(EXIT_FAILURE);
606 }
607 if (sol_file.is_open())
608 sol_file.close();
609 if (log_file.is_open())
610 log_file.close();
611 }
612
613}}
614
615// STATISTICS: driver-any
Depth-first branch-and-bound search engine.
Definition search.hh:1373
Class to send solution information to CPProfiler.
Definition search.hh:431
Class to record search trace info for CPProfiler.
Definition search.hh:428
Depth-first search engine.
Definition search.hh:1211
~CombinedStop(void)
Destructor.
Definition script.hpp:137
static void installCtrlHandler(bool install, bool force=false)
Install handler for catching Ctrl-C.
Definition script.hpp:127
virtual bool stop(const Search::Statistics &s, const Search::Options &o)
Test whether search must be stopped.
Definition script.hpp:79
static void interrupt(int)
Handler for catching Ctrl-C.
Definition script.hpp:121
@ SR_INT
Interrupted by user.
Definition script.hpp:76
@ SR_NODE
Node limit reached.
Definition script.hpp:72
@ SR_FAIL
Fail limit reached.
Definition script.hpp:73
@ SR_TIME
Time limit reached.
Definition script.hpp:74
@ SR_RESTART
Time limit reached.
Definition script.hpp:75
static Search::Stop * create(unsigned long long int node, unsigned long long int fail, double time, unsigned long long int restart, bool intr)
Create appropriate stop-object.
Definition script.hpp:98
int reason(const Search::Statistics &s, const Search::Options &o)
Report reason why search has been stopped.
Definition script.hpp:88
EngineToMeta(T *s, const Search::Options &o)
Definition script.hpp:295
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:217
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:199
static void explore(S *root, const Gist::Options &opt)
Definition script.hpp:208
Traits class for search engines.
Definition script.hpp:188
static void explore(Space *root, const Gist::Options &opt)
Definition script.hpp:190
Parametric base-class for scripts.
Definition driver.hh:930
static void run(const Options &opt, Script *s=nullptr)
Definition script.hpp:301
virtual void compare(const Space &home, std::ostream &os) const
Compare with s.
Definition script.hpp:254
virtual void print(std::ostream &os) const
Print a solution to os.
Definition script.hpp:250
static std::ostream & select_ostream(const char *sn, std::ofstream &ofs)
Choose output stream according to sn.
Definition script.hpp:258
ScriptBase(const Options &opt)
Constructor.
Definition script.hpp:240
ScriptGetInfo(void)
Initialize.
Definition script.hpp:274
virtual std::string getInfo(const Space &home) const
Return info for a space (which must be a script).
Definition script.hpp:278
Options for Gist
Definition gist.hh:234
An inspector for printing simple text output.
Definition gist.hh:188
A simple comparator.
Definition gist.hh:211
Limited discrepancy search engine.
Definition search.hh:1423
Options for scripts
Definition driver.hh:447
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:422
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:404
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:440
void restart_base(double base)
Set default restart base.
Definition options.hpp:431
Base class for cutoff generators for restart-based meta engine.
Definition search.hh:480
static Cutoff * luby(unsigned long long int scale=Config::slice)
Create generator for luby sequence with scale-factor scale.
Definition cutoff.cpp:156
static Cutoff * constant(unsigned long long int scale=Config::slice)
Create generator for constant sequence with constant s.
Definition cutoff.cpp:148
static Cutoff * linear(unsigned long long int scale=Config::slice)
Create generator for linear sequence scaled by scale.
Definition cutoff.cpp:152
static Cutoff * geometric(unsigned long long int scale=Config::slice, double base=Config::base)
Definition cutoff.cpp:160
Stop-object based on number of failures
Definition search.hh:978
Stop-object based on number of nodes
Definition search.hh:951
Search engine options
Definition search.hh:848
unsigned int c_d
Create a clone after every c_d commits (commit distance).
Definition search.hh:863
bool clone
Whether engines create a clone when being initialized.
Definition search.hh:851
const HeuristicGuidance * guidance
Guidance for heuristic search (AStar and CABS, not copied).
Definition search.hh:882
unsigned int d_l
Discrepancy limit (for LDS, reaching it does not stop the engine).
Definition search.hh:867
Cutoff * cutoff
Cutoff for restart-based search.
Definition search.hh:877
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance).
Definition search.hh:865
Stop * stop
Stop object for stopping search.
Definition search.hh:875
SearchTracer * tracer
Tracer object for tracing search.
Definition search.hh:879
unsigned int assets
Number of assets (engines) in a portfolio.
Definition search.hh:869
unsigned int slice
Size of a slice in a portfolio (in number of failures).
Definition search.hh:871
unsigned int nogoods_limit
Depth limit for extraction of no-goods.
Definition search.hh:873
double threads
Number of threads to use.
Definition search.hh:853
Stop-object based on number of restarts
Definition search.hh:1035
Search engine statistics
Definition search.hh:155
Base-class for Stop-object.
Definition search.hh:919
static Stop * time(double l)
Stop if time limit l (in milliseconds) has been exceeded.
Definition stop.cpp:55
static Stop * node(unsigned long long int l)
Stop if node limit l has been exceeded.
Definition stop.cpp:47
static Stop * fail(unsigned long long int l)
Stop if failure limit l has been exceeded.
Definition stop.cpp:51
static Stop * restart(unsigned long long int l)
Stop if restart limit l has been exceeded.
Definition stop.cpp:59
Stop-object based on time
Definition search.hh:1006
Computation spaces.
Definition core.hpp:1787
#define GECODE_DRIVER_EXPORT
Definition driver.hh:62
const int * pi[]
Definition photo.cpp:14262
Heap heap
The single global heap.
Definition heap.cpp:44
@ SM_STAT
Print statistics for script.
Definition driver.hh:100
@ SM_SOLUTION
Print solution and some statistics.
Definition driver.hh:98
@ SM_GIST
Run script in Gist.
Definition driver.hh:101
@ SM_TIME
Measure average runtime.
Definition driver.hh:99
@ RM_CONSTANT
Restart with constant sequence.
Definition driver.hh:110
@ RM_LINEAR
Restart with linear sequence.
Definition driver.hh:111
@ RM_LUBY
Restart with Luby sequence.
Definition driver.hh:112
@ RM_NONE
No restarts.
Definition driver.hh:109
@ RM_GEOMETRIC
Restart with geometric sequence.
Definition driver.hh:113
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:1002
int bab(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for branch-and-bound search of root.
Definition gist.hpp:208
int dfs(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for root.
Definition gist.hpp:203
Script commandline driver.
double dev(double t[], unsigned int n)
Compute deviation of n elements in t.
Definition script.cpp:84
void stop(Support::Timer &timer, std::ostream &os)
Get time since start of timer and print user friendly time information.
Definition script.cpp:42
Search::Cutoff * createCutoff(const Options &o)
Create cutoff object from options.
Definition script.hpp:164
double am(double t[], unsigned int n)
Compute arithmetic mean of n elements in t.
Definition script.cpp:74
Gecode toplevel namespace
Gecode::IntSet d(v, 7)
const int r[4][2]
Definition dom.cpp:152
#define forceinline
Definition config.hpp:144
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56