Generated on for Gecode by doxygen 1.17.0
driver.hh
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, 2009
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.dev
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34#ifndef GECODE_DRIVER_HH
35#define GECODE_DRIVER_HH
36
37#include <gecode/minimodel.hh>
38#include <gecode/search.hh>
39#ifdef GECODE_HAS_GIST
40#include <gecode/gist.hh>
41#endif
42
43/*
44 * Configure linking
45 *
46 */
47#if !defined(GECODE_STATIC_LIBS) && \
48 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
49
50#ifdef GECODE_BUILD_DRIVER
51#define GECODE_DRIVER_EXPORT __declspec( dllexport )
52#else
53#define GECODE_DRIVER_EXPORT __declspec( dllimport )
54#endif
55
56#else
57
58#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
59#define GECODE_DRIVER_EXPORT __attribute__ ((visibility("default")))
60#else
61#define GECODE_DRIVER_EXPORT
62#endif
63
64#endif
65
66// Configure auto-linking
67#ifndef GECODE_BUILD_DRIVER
68#define GECODE_LIBRARY_NAME "Driver"
70#endif
71
81
82namespace Gecode {
83
84
89
100
112
113 class BaseOptions;
114
115 namespace Driver {
122 protected:
123 const char* eopt;
124 const char* iopt;
125 const char* exp;
128 char* argument(int argc, char* argv[]) const;
129 public:
131 BaseOption(const char* o, const char* e);
133 virtual int parse(int argc, char* argv[]) = 0;
135 virtual void help(void) = 0;
137 virtual ~BaseOption(void);
139 static char* strdup(const char* s);
141 static char* stredup(const char* s);
143 static void strdel(const char* s);
144 };
145
151 protected:
152 const char* cur;
153 public:
155 StringValueOption(const char* o, const char* e, const char* v=nullptr);
157 void value(const char* v);
159 const char* value(void) const;
161 virtual int parse(int argc, char* argv[]);
163 virtual void help(void);
165 virtual ~StringValueOption(void);
166 };
167
168
174 protected:
176 class Value {
177 public:
178 int val;
179 const char* opt;
180 const char* help;
182 };
183 int cur;
186 public:
188 StringOption(const char* o, const char* e, int v=0);
190 void value(int v);
192 int value(void) const;
194 void add(int v, const char* o, const char* h = nullptr);
196 virtual int parse(int argc, char* argv[]);
198 virtual void help(void);
200 virtual ~StringOption(void);
201 };
202
203
209 protected:
210 int cur;
211 public:
213 IntOption(const char* o, const char* e, int v=0);
215 void value(int v);
217 int value(void) const;
219 virtual int parse(int argc, char* argv[]);
221 virtual void help(void);
222 };
223
229 protected:
230 unsigned int cur;
231 public:
233 UnsignedIntOption(const char* o, const char* e, unsigned int v=0);
235 void value(unsigned int v);
237 unsigned int value(void) const;
239 virtual int parse(int argc, char* argv[]);
241 virtual void help(void);
242 };
243
249 protected:
250 unsigned long long int cur;
251 public:
253 UnsignedLongLongIntOption(const char* o, const char* e,
254 unsigned long long int v=0);
256 void value(unsigned long long int v);
258 unsigned long long int value(void) const;
260 virtual int parse(int argc, char* argv[]);
262 virtual void help(void);
263 };
264
270 protected:
271 double cur;
272 public:
274 DoubleOption(const char* o, const char* e, double v=0);
276 void value(double v);
278 double value(void) const;
280 virtual int parse(int argc, char* argv[]);
282 virtual void help(void);
283 };
284
290 protected:
291 bool cur;
292 public:
294 BoolOption(const char* o, const char* e, bool v=false);
296 void value(bool v);
298 bool value(void) const;
300 virtual int parse(int argc, char* argv[]);
302 virtual void help(void);
303 };
304
310 protected:
312 public:
316 void value(IntPropLevel l);
318 IntPropLevel value(void) const;
320 virtual int parse(int argc, char* argv[]);
322 virtual void help(void);
323 };
324
330 protected:
331 int cur;
332 public:
334 TraceOption(int f=0);
336 void value(int f);
338 int value(void) const;
340 virtual int parse(int argc, char* argv[]);
342 virtual void help(void);
343 };
344
350 protected:
351 unsigned int cur_port;
353 public:
355 ProfilerOption(const char* o, const char* e, unsigned int p = 0, int v = -1);
357 void port(unsigned int p);
359 unsigned int port(void) const;
361 void execution_id(int i);
363 int execution_id(void) const;
365 virtual int parse(int argc, char* argv[]);
367 virtual void help(void);
368 };
369 }
370
376 protected:
379 const char* _name;
380 public:
382 BaseOptions(const char* s);
384 virtual void help(void);
385
395 void parse(int& argc, char* argv[]);
396
398 const char* name(void) const;
400 void name(const char*);
401
403 virtual ~BaseOptions(void);
404 };
405
411 protected:
413
423
425
450
452
460
461#ifdef GECODE_HAS_CPPROFILER
463#endif
464
466
467 public:
469 Options(const char* s);
470
472
473
474 void model(int v);
476 void model(int v, const char* o, const char* h = nullptr);
478 int model(void) const;
479
481 void symmetry(int v);
483 void symmetry(int v, const char* o, const char* h = nullptr);
485 int symmetry(void) const;
486
488 void propagation(int v);
490 void propagation(int v, const char* o, const char* h = nullptr);
492 int propagation(void) const;
493
495 void ipl(IntPropLevel i);
497 IntPropLevel ipl(void) const;
498
500 void branching(int v);
502 void branching(int v, const char* o, const char* h = nullptr);
504 int branching(void) const;
505
507 void decay(double d);
509 double decay(void) const;
510
512 void seed(unsigned int s);
514 unsigned int seed(void) const;
515
517 void step(double s);
519 double step(void) const;
521
523
524
525 void search(int v);
527 void search(int v, const char* o, const char* h = nullptr);
529 int search(void) const;
530
532 void solutions(unsigned long long int n);
534 unsigned long long int solutions(void) const;
535
537 void threads(double n);
539 double threads(void) const;
540
542 void c_d(unsigned int d);
544 unsigned int c_d(void) const;
545
547 void a_d(unsigned int d);
549 unsigned int a_d(void) const;
550
552 void d_l(unsigned int d);
554 unsigned int d_l(void) const;
555
557 void node(unsigned long long int n);
559 unsigned long long int node(void) const;
560
562 void fail(unsigned long long int n);
564 unsigned long long int fail(void) const;
565
567 void time(double t);
569 double time(void) const;
570
572 void assets(unsigned int n);
574 unsigned int assets(void) const;
575
577 void slice(unsigned int n);
579 unsigned int slice(void) const;
580
582 void restart(RestartMode r);
584 RestartMode restart(void) const;
585
587 void restart_base(double base);
589 double restart_base(void) const;
590
592 void restart_scale(unsigned int scale);
594 unsigned int restart_scale(void) const;
595
597 void restart_limit(unsigned long long int n);
599 unsigned long long int restart_limit(void) const;
600
602 void nogoods(bool b);
604 bool nogoods(void) const;
605
607 void nogoods_limit(unsigned int l);
609 unsigned int nogoods_limit(void) const;
610
612 void relax(double d);
614 double relax(void) const;
615
617 void interrupt(bool b);
619 bool interrupt(void) const;
621
623
624
625 void mode(ScriptMode em);
627 ScriptMode mode(void) const;
628
630 void samples(unsigned int s);
632 unsigned int samples(void) const;
633
635 void iterations(unsigned int i);
637 unsigned int iterations(void) const;
638
640 void print_last(bool p);
642 bool print_last(void) const;
643
645 void out_file(const char* f);
647 const char* out_file(void) const;
648
650 void log_file(const char* f);
652 const char* log_file(void) const;
653
655 void trace(int f);
657 int trace(void) const;
658
659#ifdef GECODE_HAS_CPPROFILER
661 void profiler_id(int i);
663 int profiler_id(void) const;
665 void profiler_port(unsigned int p);
667 unsigned int profiler_port(void) const;
668#endif
670
671#ifdef GECODE_HAS_GIST
673 class I_ {
674 private:
678 unsigned int n_click;
682 unsigned int n_solution;
686 unsigned int n_move;
690 unsigned int n_compare;
691 public:
693 I_(void);
695 void click(Gist::Inspector* i);
697 void solution(Gist::Inspector* i);
699 void move(Gist::Inspector* i);
701 void compare(Gist::Comparator* i);
702
704 Gist::Inspector* click(unsigned int i) const;
706 Gist::Inspector* solution(unsigned int i) const;
708 Gist::Inspector* move(unsigned int i) const;
710 Gist::Comparator* compare(unsigned int i) const;
711 } inspect;
712#endif
713 };
714
715}
716
717namespace Gecode {
718
724 protected:
725 unsigned int _size;
726 public:
728 SizeOptions(const char* s);
730 virtual void help(void);
732 void parse(int& argc, char* argv[]);
733
735 void size(unsigned int s);
737 unsigned int size(void) const;
738 };
739
745 protected:
746 const char* _inst;
747 public:
749 InstanceOptions(const char* s);
751 virtual void help(void);
753 void parse(int& argc, char* argv[]);
754
756 void instance(const char* s);
758 const char* instance(void) const;
761 };
762
763}
764
766
767namespace Gecode { namespace Driver {
768
776 template<class BaseSpace>
777 class ScriptBase : public BaseSpace {
778 public:
780 ScriptBase(const Options& opt);
784 virtual void print(std::ostream& os) const;
786 virtual void compare(const Space& home, std::ostream& os) const;
788 static std::ostream& select_ostream(const char* sn, std::ofstream& ofs);
798 template<class Script, template<class> class Engine, class Options>
799 static void run(const Options& opt, Script* s=nullptr);
800 private:
801 template<class Script, template<class> class Engine, class Options,
802 template<class, template<class> class> class Meta>
803 static void runMeta(const Options& opt, Script* s);
804 };
805
806#ifdef GECODE_HAS_FLOAT_VARS
807
809 template<class BaseSpace>
810 class ExtractStepOption : public BaseSpace {
811 public:
814 : BaseSpace(opt.step()) {}
815
816 ExtractStepOption(BaseSpace& e)
817 : BaseSpace(e) {}
818 };
819
820#endif
821
823 template<class BaseSpace>
824 class IgnoreStepOption : public BaseSpace {
825 public:
829 IgnoreStepOption(BaseSpace& e)
830 : BaseSpace(e) {}
831 };
832
833}}
834
836
837namespace Gecode {
838
843
850
863
876
877#ifdef GECODE_HAS_FLOAT_VARS
878
891
892#endif
893
894}
895
896#endif
897
898// STATISTICS: driver-any
Base class for script options.
Definition driver.hh:375
BaseOptions(const char *s)
Initialize options for script with name s.
virtual ~BaseOptions(void)
Destructor.
void add(Driver::BaseOption &o)
Add new option o.
virtual void help(void)
Print help text.
const char * _name
Script name.
Definition driver.hh:379
Driver::BaseOption * fst
First registered option.
Definition driver.hh:377
Driver::BaseOption * lst
Last registered option.
Definition driver.hh:378
const char * name(void) const
Return name of script.
Definition options.hpp:195
void name(const char *)
Set name of script.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Base class for options.
Definition driver.hh:120
static void strdel(const char *s)
Delete heap-allocated copy of string s.
static char * stredup(const char *s)
Create heap-allocated copy of string s with hyphen added.
virtual void help(void)=0
Print help text.
const char * eopt
String for option (excluding hyphen).
Definition driver.hh:123
static char * strdup(const char *s)
Create heap-allocated copy of string s.
char * argument(int argc, char *argv[]) const
const char * exp
Short explanation.
Definition driver.hh:125
const char * iopt
String for option (including hyphen).
Definition driver.hh:124
virtual ~BaseOption(void)
Destructor.
BaseOption(const char *o, const char *e)
Initialize for option o and explanation e.
virtual int parse(int argc, char *argv[])=0
Parse option at first position and return number of parsed arguments.
BaseOption * next
Next option Check for option and return its argument.
Definition driver.hh:126
Boolean option.
Definition driver.hh:289
bool cur
Current value.
Definition driver.hh:291
BoolOption(const char *o, const char *e, bool v=false)
Initialize for option o and explanation e and default value v.
Definition options.hpp:138
void value(bool v)
Set default value to v.
Definition options.hpp:141
virtual void help(void)
Print help text.
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
virtual void help(void)
Print help text.
double cur
Current value.
Definition driver.hh:271
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
DoubleOption(const char *o, const char *e, double v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:121
void value(double v)
Set default value to v.
Definition options.hpp:125
ExtractStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:816
ExtractStepOption(const Options &opt)
Constructor that extracts the step value.
Definition driver.hh:813
IgnoreStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:829
IgnoreStepOption(const Options &)
Constructor.
Definition driver.hh:827
void value(int v)
Set default value to v.
Definition options.hpp:74
virtual void help(void)
Print help text.
int cur
Current value.
Definition driver.hh:210
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
IntOption(const char *o, const char *e, int v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:71
Integer propagation level option.
Definition driver.hh:309
IntPropLevel cur
Current value.
Definition driver.hh:311
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
IplOption(IntPropLevel ipl=IPL_DEF)
Initialize with default value ipl.
virtual void help(void)
Print help text.
void value(IntPropLevel l)
Set default level to l.
Definition options.hpp:154
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
void port(unsigned int p)
Set default port to p.
Definition options.hpp:183
ProfilerOption(const char *o, const char *e, unsigned int p=0, int v=-1)
Initialize for option o and explanation e and default value v.
Definition options.hpp:181
void execution_id(int i)
Set default execution ID to i.
Definition options.hpp:185
int cur_execution_id
Current execution ID.
Definition driver.hh:352
unsigned int cur_port
Current port.
Definition driver.hh:351
virtual void help(void)
Print help text.
Parametric base-class for scripts.
Definition driver.hh:777
static void run(const Options &opt, Script *s=nullptr)
Definition script.hpp:301
ScriptBase(ScriptBase &e)
Constructor used for cloning.
Definition script.hpp:245
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
const char * help
Optional help text.
Definition driver.hh:180
Value * next
Next option value.
Definition driver.hh:181
int val
Value for an option value.
Definition driver.hh:178
const char * opt
String for option value.
Definition driver.hh:179
String-valued option (integer value defined by strings).
Definition driver.hh:173
int cur
Current value.
Definition driver.hh:183
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
void add(int v, const char *o, const char *h=nullptr)
Add option value for value v, string o, and help text h.
StringOption(const char *o, const char *e, int v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:55
virtual ~StringOption(void)
Destructor.
void value(int v)
Set default value to v.
Definition options.hpp:58
Value * lst
Last option value.
Definition driver.hh:185
Value * fst
First option value.
Definition driver.hh:184
virtual void help(void)
Print help text.
String-valued option.
Definition driver.hh:150
virtual void help(void)
Print help text.
virtual ~StringValueOption(void)
Destructor.
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
void value(const char *v)
Set default value to v.
StringValueOption(const char *o, const char *e, const char *v=nullptr)
Initialize for option o and explanation e and default value v.
const char * cur
Current value.
Definition driver.hh:152
Trace flag option.
Definition driver.hh:329
int cur
Current value.
Definition driver.hh:331
TraceOption(int f=0)
Initialize with no tracing.
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
void value(int f)
Set default trace flags to f.
Definition options.hpp:168
virtual void help(void)
Print help text.
Unsigned integer option.
Definition driver.hh:228
void value(unsigned int v)
Set default value to v.
Definition options.hpp:91
UnsignedIntOption(const char *o, const char *e, unsigned int v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:87
unsigned int cur
Current value.
Definition driver.hh:230
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
virtual void help(void)
Print help text.
Unsigned long long integer option.
Definition driver.hh:248
void value(unsigned long long int v)
Set default value to v.
Definition options.hpp:108
unsigned long long int cur
Current value.
Definition driver.hh:250
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
UnsignedLongLongIntOption(const char *o, const char *e, unsigned long long int v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:105
virtual void help(void)
Print help text.
Abstract base class for comparators.
Definition gist.hh:119
Abstract base class for inspectors.
Definition gist.hh:99
const char * _inst
Instance string.
Definition driver.hh:746
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
void instance(const char *s)
Set default instance name.
~InstanceOptions(void)
Destructor.
virtual void help(void)
Print help text.
InstanceOptions(const char *s)
Initialize options for script with name s.
I_(void)
Constructor.
Definition options.hpp:572
void compare(Gist::Comparator *i)
Add comparator.
Definition options.hpp:589
void click(Gist::Inspector *i)
Add inspector that reacts on node double clicks.
Definition options.hpp:577
void move(Gist::Inspector *i)
Add inspector that reacts on each move of the cursor.
Definition options.hpp:585
void solution(Gist::Inspector *i)
Add inspector that reacts on each new solution that is found.
Definition options.hpp:581
Options for scripts
Definition driver.hh:410
Driver::DoubleOption _relax
Probability to relax variable.
Definition driver.hh:447
void trace(int f)
Set trace flags.
Definition options.hpp:537
Driver::StringValueOption _log_file
Where to print statistics.
Definition driver.hh:458
void c_d(unsigned int d)
Set default copy recomputation distance.
Definition options.hpp:330
Driver::StringOption _model
General model options.
Definition driver.hh:414
void log_file(const char *f)
Set default output file name for Gecode stats.
Definition options.hpp:527
void print_last(bool p)
Set whether to print only last solution found.
Definition options.hpp:508
Driver::StringOption _mode
Script mode to run.
Definition driver.hh:453
void propagation(int v)
Set default propagation value.
Definition options.hpp:232
void iterations(unsigned int i)
Set default number of iterations.
Definition options.hpp:499
Driver::DoubleOption _decay
Decay option.
Definition driver.hh:419
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Definition driver.hh:446
void a_d(unsigned int d)
Set default adaptive recomputation distance.
Definition options.hpp:339
void profiler_id(int i)
Set profiler execution identifier.
Definition options.hpp:553
void seed(unsigned int s)
Set default seed value.
Definition options.hpp:276
Driver::BoolOption _nogoods
Whether to use no-goods.
Definition driver.hh:445
void branching(int v)
Set default branching value.
Definition options.hpp:254
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
Definition driver.hh:439
Driver::UnsignedLongLongIntOption _r_limit
Cutoff for number of restarts.
Definition driver.hh:444
Driver::TraceOption _trace
Trace flags for tracing.
Definition driver.hh:459
Driver::UnsignedLongLongIntOption _fail
Cutoff for number of failures.
Definition driver.hh:436
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Definition driver.hh:432
void slice(unsigned int n)
Set default slice size in a portfolio.
Definition options.hpp:393
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
Definition driver.hh:438
void search(int v)
Set default search value.
Definition options.hpp:299
Driver::UnsignedLongLongIntOption _node
Cutoff for number of nodes.
Definition driver.hh:434
void nogoods(bool b)
Set default nogoods posting behavior.
Definition options.hpp:438
void symmetry(int v)
Set default symmetry value.
Definition options.hpp:219
void profiler_port(unsigned int p)
Set profiler port.
Definition options.hpp:561
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Definition driver.hh:455
Driver::StringOption _search
Search options.
Definition driver.hh:426
Driver::StringOption _propagation
Propagation options.
Definition driver.hh:416
Driver::IplOption _ipl
Integer propagation level.
Definition driver.hh:417
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:402
Driver::UnsignedLongLongIntOption _solutions
How many solutions.
Definition driver.hh:428
Options(const char *s)
Initialize options for script with name s.
Driver::BoolOption _print_last
Print only last solution found.
Definition driver.hh:456
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition driver.hh:430
void nogoods_limit(unsigned int l)
Set default nogoods depth limit.
Definition options.hpp:447
void step(double s)
Set default step value.
Definition options.hpp:285
Driver::ProfilerOption _profiler
Options for the CP Profiler.
Definition driver.hh:462
void relax(double d)
Set default relax probability.
Definition options.hpp:456
void ipl(IntPropLevel i)
Set default integer propagation level.
Definition options.hpp:245
Driver::DoubleOption _threads
How many threads to use.
Definition driver.hh:429
Driver::StringOption _branching
Branching options.
Definition driver.hh:418
Driver::StringOption _restart
Restart method option.
Definition driver.hh:440
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:384
Driver::UnsignedIntOption _seed
Seed option.
Definition driver.hh:420
Driver::DoubleOption _step
Step option.
Definition driver.hh:421
void time(double t)
Set default time cutoff.
Definition options.hpp:375
Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition driver.hh:442
void solutions(unsigned long long int n)
Set default number of solutions to search for.
Definition options.hpp:312
Driver::DoubleOption _time
Cutoff for time.
Definition driver.hh:437
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:420
void interrupt(bool b)
Set default interrupt behavior.
Definition options.hpp:467
void restart_base(double base)
Set default restart base.
Definition options.hpp:411
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition driver.hh:448
void d_l(unsigned int d)
Set default discrepancy limit for LDS.
Definition options.hpp:348
void model(int v)
Set default model value.
Definition options.hpp:206
void decay(double d)
Set default decay factor.
Definition options.hpp:267
Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition driver.hh:431
void samples(unsigned int s)
Set default number of samples.
Definition options.hpp:490
void out_file(const char *f)
Set default output file name for solutions.
Definition options.hpp:517
Driver::DoubleOption _r_base
Restart base.
Definition driver.hh:441
Driver::StringOption _symmetry
General symmetry options.
Definition driver.hh:415
Driver::StringValueOption _out_file
Where to print solutions.
Definition driver.hh:457
Driver::UnsignedIntOption _samples
How many samples.
Definition driver.hh:454
void node(unsigned long long int n)
Set default node cutoff.
Definition options.hpp:357
void mode(ScriptMode em)
Set default mode.
Definition options.hpp:481
void fail(unsigned long long int n)
Set default failure cutoff.
Definition options.hpp:366
void threads(double n)
Set number of parallel threads.
Definition options.hpp:321
void restart_limit(unsigned long long int n)
Set default restart cutoff.
Definition options.hpp:429
virtual void help(void)
Print help text.
SizeOptions(const char *s)
Initialize options for script with name s.
unsigned int _size
Size value.
Definition driver.hh:725
void size(unsigned int s)
Set default size.
Definition options.hpp:615
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Computation spaces.
Definition core.hpp:1775
Array with arbitrary number of elements.
#define GECODE_DRIVER_EXPORT
Definition driver.hh:59
ScriptMode
Different modes for executing scripts.
Definition driver.hh:94
RestartMode
Different modes for restart-based search.
Definition driver.hh:105
@ SM_STAT
Print statistics for script.
Definition driver.hh:97
@ SM_SOLUTION
Print solution and some statistics.
Definition driver.hh:95
@ SM_GIST
Run script in Gist.
Definition driver.hh:98
@ SM_TIME
Measure average runtime.
Definition driver.hh:96
@ RM_CONSTANT
Restart with constant sequence.
Definition driver.hh:107
@ RM_LINEAR
Restart with linear sequence.
Definition driver.hh:108
@ RM_LUBY
Restart with Luby sequence.
Definition driver.hh:109
@ RM_NONE
No restarts.
Definition driver.hh:106
@ RM_GEOMETRIC
Restart with geometric sequence.
Definition driver.hh:110
Driver::ScriptBase< Driver::IgnoreStepOption< IntMaximizeSpace > > IntMaximizeScript
Base-class for scripts for finding solution of highest integer cost.
Definition driver.hh:862
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:849
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Definition driver.hh:884
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
Definition driver.hh:890
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMaximizeSpace > > IntLexMaximizeScript
Base-class for scripts for finding solution of lexically highest integer costs.
Definition driver.hh:875
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMinimizeSpace > > IntLexMinimizeScript
Base-class for scripts for finding solution of lexically lowest integer costs.
Definition driver.hh:869
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Definition driver.hh:856
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:1008
@ IPL_DEF
Simple propagation levels.
Definition int.hh:1010
Gecode toplevel namespace