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#include <gecode/instance.hh>
40#ifdef GECODE_HAS_GIST
41#include <gecode/gist.hh>
42#endif
43
44#include <memory>
45
46/*
47 * Configure linking
48 *
49 */
50#if !defined(GECODE_STATIC_LIBS) && \
51 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
52
53#ifdef GECODE_BUILD_DRIVER
54#define GECODE_DRIVER_EXPORT __declspec( dllexport )
55#else
56#define GECODE_DRIVER_EXPORT __declspec( dllimport )
57#endif
58
59#else
60
61#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
62#define GECODE_DRIVER_EXPORT __attribute__ ((visibility("default")))
63#else
64#define GECODE_DRIVER_EXPORT
65#endif
66
67#endif
68
69// Configure auto-linking
70#ifndef GECODE_BUILD_DRIVER
71#define GECODE_LIBRARY_NAME "Driver"
73#endif
74
84
85namespace Gecode {
86
87
92
103
115
116 class BaseOptions;
117
118 namespace Driver {
125 protected:
126 const char* eopt;
127 const char* iopt;
128 const char* exp;
131 char* argument(int argc, char* argv[]) const;
132 public:
134 BaseOption(const char* o, const char* e);
136 virtual int parse(int argc, char* argv[]) = 0;
138 virtual void help(void) = 0;
140 virtual ~BaseOption(void);
142 static char* strdup(const char* s);
144 static char* stredup(const char* s);
146 static void strdel(const char* s);
147 };
148
154 protected:
155 const char* cur;
156 public:
158 StringValueOption(const char* o, const char* e, const char* v=nullptr);
160 void value(const char* v);
162 const char* value(void) const;
164 virtual int parse(int argc, char* argv[]);
166 virtual void help(void);
168 virtual ~StringValueOption(void);
169 };
170
177 public:
179 StringListOption(const char* o, const char* e);
181 virtual int parse(int argc, char* argv[]);
182 };
183
184
190 protected:
192 class Value {
193 public:
194 int val;
195 const char* opt;
196 const char* help;
198 };
199 int cur;
202 public:
204 StringOption(const char* o, const char* e, int v=0);
206 void value(int v);
208 int value(void) const;
210 void add(int v, const char* o, const char* h = nullptr);
212 virtual int parse(int argc, char* argv[]);
214 virtual void help(void);
216 virtual ~StringOption(void);
217 };
218
219
225 protected:
226 int cur;
227 public:
229 IntOption(const char* o, const char* e, int v=0);
231 void value(int v);
233 int value(void) const;
235 virtual int parse(int argc, char* argv[]);
237 virtual void help(void);
238 };
239
245 protected:
246 unsigned int cur;
247 public:
249 UnsignedIntOption(const char* o, const char* e, unsigned int v=0);
251 void value(unsigned int v);
253 unsigned int value(void) const;
255 virtual int parse(int argc, char* argv[]);
257 virtual void help(void);
258 };
259
265 protected:
266 unsigned long long int cur;
267 public:
269 UnsignedLongLongIntOption(const char* o, const char* e,
270 unsigned long long int v=0);
272 void value(unsigned long long int v);
274 unsigned long long int value(void) const;
276 virtual int parse(int argc, char* argv[]);
278 virtual void help(void);
279 };
280
286 protected:
287 double cur;
288 public:
290 DoubleOption(const char* o, const char* e, double v=0);
292 void value(double v);
294 double value(void) const;
296 virtual int parse(int argc, char* argv[]);
298 virtual void help(void);
299 };
300
306 protected:
307 bool cur;
308 public:
310 BoolOption(const char* o, const char* e, bool v=false);
312 void value(bool v);
314 bool value(void) const;
316 virtual int parse(int argc, char* argv[]);
318 virtual void help(void);
319 };
320
326 protected:
328 public:
332 void value(IntPropLevel l);
334 IntPropLevel value(void) const;
336 virtual int parse(int argc, char* argv[]);
338 virtual void help(void);
339 };
340
346 protected:
347 int cur;
348 public:
350 TraceOption(int f=0);
352 void value(int f);
354 int value(void) const;
356 virtual int parse(int argc, char* argv[]);
358 virtual void help(void);
359 };
360
366 protected:
367 unsigned int cur_port;
369 public:
371 ProfilerOption(const char* o, const char* e, unsigned int p = 0, int v = -1);
373 void port(unsigned int p);
375 unsigned int port(void) const;
377 void execution_id(int i);
379 int execution_id(void) const;
381 virtual int parse(int argc, char* argv[]);
383 virtual void help(void);
384 };
385 }
386
392 protected:
395 const char* _name;
396 public:
398 BaseOptions(const char* s);
400 virtual void help(void);
401
403 void add(Driver::BaseOption& o);
414 void parse(int& argc, char* argv[]);
415
427 void parse(int& argc, char* argv[], bool strict);
428
430 void parse_strict(int& argc, char* argv[]);
432 void parse_permissive(int& argc, char* argv[]);
433
435 const char* name(void) const;
437 void name(const char*);
438
440 virtual ~BaseOptions(void);
441 };
442
448 protected:
450
460
462
486#ifdef GECODE_HAS_EXPERIMENTAL
489#endif
491
493
501
502#ifdef GECODE_HAS_CPPROFILER
504#endif
505
507
508 public:
510 Options(const char* s);
511
513
514
515 void model(int v);
517 void model(int v, const char* o, const char* h = nullptr);
519 int model(void) const;
520
522 void symmetry(int v);
524 void symmetry(int v, const char* o, const char* h = nullptr);
526 int symmetry(void) const;
527
529 void propagation(int v);
531 void propagation(int v, const char* o, const char* h = nullptr);
533 int propagation(void) const;
534
536 void ipl(IntPropLevel i);
538 IntPropLevel ipl(void) const;
539
541 void branching(int v);
543 void branching(int v, const char* o, const char* h = nullptr);
545 int branching(void) const;
546
548 void decay(double d);
550 double decay(void) const;
551
553 void seed(unsigned int s);
555 unsigned int seed(void) const;
556
558 void step(double s);
560 double step(void) const;
562
564
565
566 void search(int v);
568 void search(int v, const char* o, const char* h = nullptr);
570 int search(void) const;
571
573 void solutions(unsigned long long int n);
575 unsigned long long int solutions(void) const;
576
578 void threads(double n);
580 double threads(void) const;
581
583 void c_d(unsigned int d);
585 unsigned int c_d(void) const;
586
588 void a_d(unsigned int d);
590 unsigned int a_d(void) const;
591
593 void d_l(unsigned int d);
595 unsigned int d_l(void) const;
596
598 void node(unsigned long long int n);
600 unsigned long long int node(void) const;
601
603 void fail(unsigned long long int n);
605 unsigned long long int fail(void) const;
606
608 void time(double t);
610 double time(void) const;
611
613 void assets(unsigned int n);
615 unsigned int assets(void) const;
616
618 void slice(unsigned int n);
620 unsigned int slice(void) const;
621
623 void restart(RestartMode r);
625 RestartMode restart(void) const;
626
628 void restart_base(double base);
630 double restart_base(void) const;
631
633 void restart_scale(unsigned int scale);
635 unsigned int restart_scale(void) const;
636
638 void restart_limit(unsigned long long int n);
640 unsigned long long int restart_limit(void) const;
641
643 void nogoods(bool b);
645 bool nogoods(void) const;
646
648 void nogoods_limit(unsigned int l);
650 unsigned int nogoods_limit(void) const;
651
653 void relax(double d);
655 double relax(void) const;
656
658 void interrupt(bool b);
660 bool interrupt(void) const;
662
664
665
666 void mode(ScriptMode em);
668 ScriptMode mode(void) const;
669
671 void samples(unsigned int s);
673 unsigned int samples(void) const;
674
676 void iterations(unsigned int i);
678 unsigned int iterations(void) const;
679
681 void print_last(bool p);
683 bool print_last(void) const;
684
686 void out_file(const char* f);
688 const char* out_file(void) const;
689
691 void log_file(const char* f);
693 const char* log_file(void) const;
694
696 void trace(int f);
698 int trace(void) const;
699
700#ifdef GECODE_HAS_CPPROFILER
702 void profiler_id(int i);
704 int profiler_id(void) const;
706 void profiler_port(unsigned int p);
708 unsigned int profiler_port(void) const;
709#endif
711
712#ifdef GECODE_HAS_EXPERIMENTAL
714
715
716 void guidance(const Search::HeuristicGuidance* g);
718 const Search::HeuristicGuidance* guidance(void) const;
720#endif
721
722#ifdef GECODE_HAS_GIST
724 class I_ {
725 private:
729 unsigned int n_click;
733 unsigned int n_solution;
737 unsigned int n_move;
741 unsigned int n_compare;
742 public:
744 I_(void);
746 void click(Gist::Inspector* i);
748 void solution(Gist::Inspector* i);
750 void move(Gist::Inspector* i);
752 void compare(Gist::Comparator* i);
753
755 Gist::Inspector* click(unsigned int i) const;
757 Gist::Inspector* solution(unsigned int i) const;
759 Gist::Inspector* move(unsigned int i) const;
761 Gist::Comparator* compare(unsigned int i) const;
762 } inspect;
763#endif
764 };
765
766}
767
768namespace Gecode {
769
775 protected:
776 unsigned int _size;
777 public:
779 SizeOptions(const char* s);
781 virtual void help(void);
783 void parse(int& argc, char* argv[]);
792 void parse(int& argc, char* argv[], bool strict);
794 void parse_strict(int& argc, char* argv[]);
796 void parse_permissive(int& argc, char* argv[]);
797
799 void size(unsigned int s);
801 unsigned int size(void) const;
802 };
803
834 * \ingroup TaskDriverCmd
835 */
837 protected:
838 const char* _inst;
839 const char* _spec;
842 mutable std::unique_ptr<Instance::Data> _data;
844 void forget(void) const;
845 public:
847 InstanceOptions(const char* s);
855 InstanceOptions(const char* s, const char* spec);
857 virtual void help(void);
859 void parse(int& argc, char* argv[]);
869 void parse(int& argc, char* argv[], bool strict);
871 void parse_strict(int& argc, char* argv[]);
873 void parse_permissive(int& argc, char* argv[]);
874
876 void instance(const char* s);
878 const char* instance(void) const;
888 bool builtin(unsigned int& i) const;
889
891 void spec(const char* s);
893 const char* spec(void) const;
895 void spec_file(const char* f);
897 const char* spec_file(void) const;
899 void param(const char* p);
901 const char* param(void) const;
903 bool is_file(void) const;
911 Instance::Data data(void) const;
913 ~InstanceOptions(void);
914 };
915
916}
917
919
920namespace Gecode { namespace Driver {
921
929 template<class BaseSpace>
930 class ScriptBase : public BaseSpace {
931 public:
933 ScriptBase(const Options& opt);
937 virtual void print(std::ostream& os) const;
939 virtual void compare(const Space& home, std::ostream& os) const;
941 static std::ostream& select_ostream(const char* sn, std::ofstream& ofs);
951 template<class Script, template<class> class Engine, class Options>
952 static void run(const Options& opt, Script* s=nullptr);
953 private:
954 template<class Script, template<class> class Engine, class Options,
955 template<class, template<class> class> class Meta>
956 static void runMeta(const Options& opt, Script* s);
957 };
958
959#ifdef GECODE_HAS_FLOAT_VARS
960
962 template<class BaseSpace>
963 class ExtractStepOption : public BaseSpace {
964 public:
967 : BaseSpace(opt.step()) {}
968
969 ExtractStepOption(BaseSpace& e)
970 : BaseSpace(e) {}
971 };
972
973#endif
974
976 template<class BaseSpace>
977 class IgnoreStepOption : public BaseSpace {
978 public:
982 IgnoreStepOption(BaseSpace& e)
983 : BaseSpace(e) {}
984 };
985
986}}
987
989
990namespace Gecode {
991
996
1003
1016
1029
1030#ifdef GECODE_HAS_FLOAT_VARS
1031
1044
1045#endif
1046
1047}
1048
1049#endif
1050
1051// STATISTICS: driver-any
Base class for script options.
Definition driver.hh:391
BaseOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:546
void add(Driver::BaseOption &o)
Add new option o.
Definition options.cpp:537
void parse_strict(int &argc, char *argv[])
Parse options with strict checking (equivalent to parse() with true).
Definition options.hpp:195
const char * _name
Script name.
Definition driver.hh:395
Driver::BaseOption * fst
First registered option.
Definition driver.hh:393
Driver::BaseOption * lst
Last registered option.
Definition driver.hh:394
const char * name(void) const
Return name of script.
Definition options.hpp:204
void parse_permissive(int &argc, char *argv[])
Parse options partially (equivalent to parse() with false).
Definition options.hpp:199
virtual void help(void)
Print help text.
Definition options.cpp:557
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:611
Base class for options.
Definition driver.hh:123
static void strdel(const char *s)
Delete heap-allocated copy of string s.
Definition options.cpp:77
virtual void help(void)=0
Print help text.
static char * stredup(const char *s)
Create heap-allocated copy of string s with hyphen added.
Definition options.cpp:66
const char * eopt
String for option (excluding hyphen).
Definition driver.hh:126
char * argument(int argc, char *argv[]) const
Definition options.cpp:84
static char * strdup(const char *s)
Create heap-allocated copy of string s.
Definition options.cpp:56
const char * exp
Short explanation.
Definition driver.hh:128
const char * iopt
String for option (including hyphen).
Definition driver.hh:127
BaseOption(const char *o, const char *e)
Initialize for option o and explanation e.
Definition options.cpp:105
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:129
Boolean option.
Definition driver.hh:305
bool cur
Current value.
Definition driver.hh:307
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:290
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.
Definition options.cpp:322
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:273
double cur
Current value.
Definition driver.hh:287
virtual void help(void)
Print help text.
Definition options.cpp:282
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:969
ExtractStepOption(const Options &opt)
Constructor that extracts the step value.
Definition driver.hh:966
IgnoreStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:982
IgnoreStepOption(const Options &)
Constructor.
Definition driver.hh:980
virtual void help(void)
Print help text.
Definition options.cpp:232
void value(int v)
Set default value to v.
Definition options.hpp:74
int cur
Current value.
Definition driver.hh:226
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:223
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:325
IntPropLevel cur
Current value.
Definition driver.hh:327
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:338
IplOption(IntPropLevel ipl=IPL_DEF)
Initialize with default value ipl.
Definition options.cpp:333
virtual void help(void)
Print help text.
Definition options.cpp:373
void value(IntPropLevel l)
Set default level to l.
Definition options.hpp:154
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:368
unsigned int cur_port
Current port.
Definition driver.hh:367
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:517
virtual void help(void)
Print help text.
Definition options.cpp:531
Parametric base-class for scripts.
Definition driver.hh:930
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
String-valued option that may be given several times.
Definition driver.hh:176
StringListOption(const char *o, const char *e)
Initialize for option o and explanation e.
Definition options.cpp:142
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:145
const char * help
Optional help text.
Definition driver.hh:196
Value * next
Next option value.
Definition driver.hh:197
int val
Value for an option value.
Definition driver.hh:194
const char * opt
String for option value.
Definition driver.hh:195
String-valued option (integer value defined by strings).
Definition driver.hh:189
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:176
int cur
Current value.
Definition driver.hh:199
void add(int v, const char *o, const char *h=nullptr)
Add option value for value v, string o, and help text h.
Definition options.cpp:162
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 void help(void)
Print help text.
Definition options.cpp:191
void value(int v)
Set default value to v.
Definition options.hpp:58
Value * lst
Last option value.
Definition driver.hh:201
Value * fst
First option value.
Definition driver.hh:200
String-valued option.
Definition driver.hh:153
virtual void help(void)
Print help text.
Definition options.cpp:132
void value(const char *v)
Set default value to v.
Definition options.cpp:119
StringValueOption(const char *o, const char *e, const char *v=nullptr)
Initialize for option o and explanation e and default value v.
Definition options.cpp:115
const char * cur
Current value.
Definition driver.hh:155
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:124
Trace flag option.
Definition driver.hh:345
virtual void help(void)
Print help text.
Definition options.cpp:458
int cur
Current value.
Definition driver.hh:347
TraceOption(int f=0)
Initialize with no tracing.
Definition options.cpp:399
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:404
void value(int f)
Set default trace flags to f.
Definition options.hpp:168
Unsigned integer option.
Definition driver.hh:244
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
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:239
unsigned int cur
Current value.
Definition driver.hh:246
virtual void help(void)
Print help text.
Definition options.cpp:248
Unsigned long long integer option.
Definition driver.hh:264
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:256
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:266
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.
Definition options.cpp:265
Abstract base class for comparators.
Definition gist.hh:119
Abstract base class for inspectors.
Definition gist.hh:99
bool builtin(unsigned int &i) const
Test whether the instance is the number of a built-in instance.
Definition options.cpp:862
const char * _inst
Instance string.
Definition driver.hh:836
bool is_file(void) const
Test whether the instance names a readable file.
Definition options.cpp:882
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:833
void instance(const char *s)
Set default instance name.
Definition options.cpp:800
virtual void help(void)
Print help text.
Definition options.cpp:826
Driver::StringListOption _param
Parameters for the spec.
Definition driver.hh:839
void forget(void) const
Definition options.cpp:795
const char * _spec
Reader spec for instance files.
Definition driver.hh:837
Instance::Data data(void) const
Read the instance file.
Definition options.cpp:893
void param(const char *p)
Set the spec parameters (name=value, separated by commas).
Definition options.cpp:820
void spec_file(const char *f)
Set the file with a reader spec that replaces spec().
Definition options.cpp:814
std::unique_ptr< Instance::Data > _data
Data read, or null Forget the data read.
Definition driver.hh:840
InstanceOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:783
void spec(const char *s)
Set the reader spec for instance files.
Definition options.cpp:807
void parse_strict(int &argc, char *argv[])
Parse options with strict checking (equivalent to parse() with true).
Definition options.hpp:657
Driver::StringValueOption _spec_file
File with a reader spec.
Definition driver.hh:838
void parse_permissive(int &argc, char *argv[])
Parse options partially (equivalent to parse() with false).
Definition options.hpp:661
Named values read from an instance.
Definition instance.hh:406
I_(void)
Constructor.
Definition options.hpp:592
void compare(Gist::Comparator *i)
Add comparator.
Definition options.hpp:609
void click(Gist::Inspector *i)
Add inspector that reacts on node double clicks.
Definition options.hpp:597
void move(Gist::Inspector *i)
Add inspector that reacts on each move of the cursor.
Definition options.hpp:605
void solution(Gist::Inspector *i)
Add inspector that reacts on each new solution that is found.
Definition options.hpp:601
Options for scripts
Definition driver.hh:447
Driver::DoubleOption _relax
Probability to relax variable.
Definition driver.hh:484
void trace(int f)
Set trace flags.
Definition options.hpp:557
Driver::StringValueOption _log_file
Where to print statistics.
Definition driver.hh:499
void c_d(unsigned int d)
Set default copy recomputation distance.
Definition options.hpp:350
Driver::StringOption _model
General model options.
Definition driver.hh:451
void log_file(const char *f)
Set default output file name for Gecode stats.
Definition options.hpp:547
void print_last(bool p)
Set whether to print only last solution found.
Definition options.hpp:528
Driver::StringOption _mode
Script mode to run.
Definition driver.hh:494
void propagation(int v)
Set default propagation value.
Definition options.hpp:241
void iterations(unsigned int i)
Set default number of iterations.
Definition options.hpp:519
Driver::DoubleOption _decay
Decay option.
Definition driver.hh:456
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Definition driver.hh:483
void a_d(unsigned int d)
Set default adaptive recomputation distance.
Definition options.hpp:359
void profiler_id(int i)
Set profiler execution identifier.
Definition options.hpp:573
void seed(unsigned int s)
Set default seed value.
Definition options.hpp:285
Driver::BoolOption _nogoods
Whether to use no-goods.
Definition driver.hh:482
void branching(int v)
Set default branching value.
Definition options.hpp:263
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
Definition driver.hh:476
Driver::UnsignedLongLongIntOption _r_limit
Cutoff for number of restarts.
Definition driver.hh:481
Driver::TraceOption _trace
Trace flags for tracing.
Definition driver.hh:500
Driver::UnsignedLongLongIntOption _fail
Cutoff for number of failures.
Definition driver.hh:473
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Definition driver.hh:469
void slice(unsigned int n)
Set default slice size in a portfolio.
Definition options.hpp:413
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
Definition driver.hh:475
void search(int v)
Set default search value.
Definition options.hpp:308
Driver::UnsignedLongLongIntOption _node
Cutoff for number of nodes.
Definition driver.hh:471
void nogoods(bool b)
Set default nogoods posting behavior.
Definition options.hpp:458
void symmetry(int v)
Set default symmetry value.
Definition options.hpp:228
void profiler_port(unsigned int p)
Set profiler port.
Definition options.hpp:581
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Definition driver.hh:496
Driver::StringOption _search
Search options.
Definition driver.hh:463
Driver::StringOption _propagation
Propagation options.
Definition driver.hh:453
Driver::IplOption _ipl
Integer propagation level.
Definition driver.hh:454
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:422
Driver::UnsignedLongLongIntOption _solutions
How many solutions.
Definition driver.hh:465
Options(const char *s)
Initialize options for script with name s.
Definition options.cpp:656
Driver::BoolOption _print_last
Print only last solution found.
Definition driver.hh:497
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition driver.hh:467
void nogoods_limit(unsigned int l)
Set default nogoods depth limit.
Definition options.hpp:467
void step(double s)
Set default step value.
Definition options.hpp:294
const Search::HeuristicGuidance * _guidance
Guidance for heuristic search.
Definition driver.hh:488
Driver::ProfilerOption _profiler
Options for the CP Profiler.
Definition driver.hh:503
void relax(double d)
Set default relax probability.
Definition options.hpp:476
void ipl(IntPropLevel i)
Set default integer propagation level.
Definition options.hpp:254
Driver::DoubleOption _threads
How many threads to use.
Definition driver.hh:466
Driver::StringOption _branching
Branching options.
Definition driver.hh:455
Driver::StringOption _restart
Restart method option.
Definition driver.hh:477
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:404
Driver::UnsignedIntOption _seed
Seed option.
Definition driver.hh:457
Driver::DoubleOption _step
Step option.
Definition driver.hh:458
void time(double t)
Set default time cutoff.
Definition options.hpp:395
Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition driver.hh:479
void solutions(unsigned long long int n)
Set default number of solutions to search for.
Definition options.hpp:321
Driver::DoubleOption _time
Cutoff for time.
Definition driver.hh:474
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:440
void interrupt(bool b)
Set default interrupt behavior.
Definition options.hpp:487
void restart_base(double base)
Set default restart base.
Definition options.hpp:431
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition driver.hh:485
void d_l(unsigned int d)
Set default discrepancy limit for LDS.
Definition options.hpp:368
void model(int v)
Set default model value.
Definition options.hpp:215
void decay(double d)
Set default decay factor.
Definition options.hpp:276
Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition driver.hh:468
void samples(unsigned int s)
Set default number of samples.
Definition options.hpp:510
void out_file(const char *f)
Set default output file name for solutions.
Definition options.hpp:537
Driver::DoubleOption _r_base
Restart base.
Definition driver.hh:478
Driver::StringOption _symmetry
General symmetry options.
Definition driver.hh:452
void guidance(const Search::HeuristicGuidance *g)
Set guidance for heuristic search (not copied).
Definition options.hpp:340
Driver::StringValueOption _out_file
Where to print solutions.
Definition driver.hh:498
Driver::UnsignedIntOption _samples
How many samples.
Definition driver.hh:495
void node(unsigned long long int n)
Set default node cutoff.
Definition options.hpp:377
void mode(ScriptMode em)
Set default mode.
Definition options.hpp:501
void fail(unsigned long long int n)
Set default failure cutoff.
Definition options.hpp:386
void threads(double n)
Set number of parallel threads.
Definition options.hpp:330
void restart_limit(unsigned long long int n)
Set default restart cutoff.
Definition options.hpp:449
Guidance for heuristic search engines (experimental).
Definition search.hh:1259
virtual void help(void)
Print help text.
Definition options.cpp:745
void parse_strict(int &argc, char *argv[])
Parse options with strict checking (equivalent to parse() with true).
Definition options.hpp:635
void parse_permissive(int &argc, char *argv[])
Parse options partially (equivalent to parse() with false).
Definition options.hpp:639
SizeOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:741
unsigned int _size
Size value.
Definition driver.hh:776
void size(unsigned int s)
Set default size.
Definition options.hpp:644
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:752
Computation spaces.
Definition core.hpp:1787
Array with arbitrary number of elements.
#define GECODE_DRIVER_EXPORT
Definition driver.hh:62
ScriptMode
Different modes for executing scripts.
Definition driver.hh:97
RestartMode
Different modes for restart-based search.
Definition driver.hh:108
@ 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< IntMaximizeSpace > > IntMaximizeScript
Base-class for scripts for finding solution of highest integer cost.
Definition driver.hh:1015
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:1002
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Definition driver.hh:1037
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
Definition driver.hh:1043
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMaximizeSpace > > IntLexMaximizeScript
Base-class for scripts for finding solution of lexically highest integer costs.
Definition driver.hh:1028
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMinimizeSpace > > IntLexMinimizeScript
Base-class for scripts for finding solution of lexically lowest integer costs.
Definition driver.hh:1022
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Definition driver.hh:1009
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:1274
@ IPL_DEF
Simple propagation levels.
Definition int.hh:1276
Gecode toplevel namespace