Generated on for Gecode by doxygen 1.18.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
411 void parse(int& argc, char* argv[]);
412
414 const char* name(void) const;
416 void name(const char*);
417
419 virtual ~BaseOptions(void);
420 };
421
427 protected:
429
439
441
465#ifdef GECODE_HAS_EXPERIMENTAL
468#endif
470
472
480
481#ifdef GECODE_HAS_CPPROFILER
483#endif
484
486
487 public:
489 Options(const char* s);
490
492
493
494 void model(int v);
496 void model(int v, const char* o, const char* h = nullptr);
498 int model(void) const;
499
501 void symmetry(int v);
503 void symmetry(int v, const char* o, const char* h = nullptr);
505 int symmetry(void) const;
506
508 void propagation(int v);
510 void propagation(int v, const char* o, const char* h = nullptr);
512 int propagation(void) const;
513
515 void ipl(IntPropLevel i);
517 IntPropLevel ipl(void) const;
518
520 void branching(int v);
522 void branching(int v, const char* o, const char* h = nullptr);
524 int branching(void) const;
525
527 void decay(double d);
529 double decay(void) const;
530
532 void seed(unsigned int s);
534 unsigned int seed(void) const;
535
537 void step(double s);
539 double step(void) const;
541
543
544
545 void search(int v);
547 void search(int v, const char* o, const char* h = nullptr);
549 int search(void) const;
550
552 void solutions(unsigned long long int n);
554 unsigned long long int solutions(void) const;
555
557 void threads(double n);
559 double threads(void) const;
560
562 void c_d(unsigned int d);
564 unsigned int c_d(void) const;
565
567 void a_d(unsigned int d);
569 unsigned int a_d(void) const;
570
572 void d_l(unsigned int d);
574 unsigned int d_l(void) const;
575
577 void node(unsigned long long int n);
579 unsigned long long int node(void) const;
580
582 void fail(unsigned long long int n);
584 unsigned long long int fail(void) const;
585
587 void time(double t);
589 double time(void) const;
590
592 void assets(unsigned int n);
594 unsigned int assets(void) const;
595
597 void slice(unsigned int n);
599 unsigned int slice(void) const;
600
602 void restart(RestartMode r);
604 RestartMode restart(void) const;
605
607 void restart_base(double base);
609 double restart_base(void) const;
610
612 void restart_scale(unsigned int scale);
614 unsigned int restart_scale(void) const;
615
617 void restart_limit(unsigned long long int n);
619 unsigned long long int restart_limit(void) const;
620
622 void nogoods(bool b);
624 bool nogoods(void) const;
625
627 void nogoods_limit(unsigned int l);
629 unsigned int nogoods_limit(void) const;
630
632 void relax(double d);
634 double relax(void) const;
635
637 void interrupt(bool b);
639 bool interrupt(void) const;
641
643
644
645 void mode(ScriptMode em);
647 ScriptMode mode(void) const;
648
650 void samples(unsigned int s);
652 unsigned int samples(void) const;
653
655 void iterations(unsigned int i);
657 unsigned int iterations(void) const;
658
660 void print_last(bool p);
662 bool print_last(void) const;
663
665 void out_file(const char* f);
667 const char* out_file(void) const;
668
670 void log_file(const char* f);
672 const char* log_file(void) const;
673
675 void trace(int f);
677 int trace(void) const;
678
679#ifdef GECODE_HAS_CPPROFILER
681 void profiler_id(int i);
683 int profiler_id(void) const;
685 void profiler_port(unsigned int p);
687 unsigned int profiler_port(void) const;
688#endif
690
691#ifdef GECODE_HAS_EXPERIMENTAL
693
694
695 void guidance(const Search::HeuristicGuidance* g);
697 const Search::HeuristicGuidance* guidance(void) const;
699#endif
700
701#ifdef GECODE_HAS_GIST
703 class I_ {
704 private:
708 unsigned int n_click;
712 unsigned int n_solution;
716 unsigned int n_move;
720 unsigned int n_compare;
721 public:
723 I_(void);
725 void click(Gist::Inspector* i);
727 void solution(Gist::Inspector* i);
729 void move(Gist::Inspector* i);
731 void compare(Gist::Comparator* i);
732
734 Gist::Inspector* click(unsigned int i) const;
736 Gist::Inspector* solution(unsigned int i) const;
738 Gist::Inspector* move(unsigned int i) const;
740 Gist::Comparator* compare(unsigned int i) const;
741 } inspect;
742#endif
743 };
744
745}
746
747namespace Gecode {
748
754 protected:
755 unsigned int _size;
756 public:
758 SizeOptions(const char* s);
760 virtual void help(void);
762 void parse(int& argc, char* argv[]);
763
765 void size(unsigned int s);
767 unsigned int size(void) const;
768 };
769
800 * \ingroup TaskDriverCmd
801 */
803 protected:
804 const char* _inst;
805 const char* _spec;
808 mutable std::unique_ptr<Instance::Data> _data;
810 void forget(void) const;
811 public:
813 InstanceOptions(const char* s);
821 InstanceOptions(const char* s, const char* spec);
823 virtual void help(void);
825 void parse(int& argc, char* argv[]);
828 void instance(const char* s);
830 const char* instance(void) const;
840 bool builtin(unsigned int& i) const;
843 void spec(const char* s);
845 const char* spec(void) const;
847 void spec_file(const char* f);
849 const char* spec_file(void) const;
851 void param(const char* p);
853 const char* param(void) const;
855 bool is_file(void) const;
863 Instance::Data data(void) const;
865 ~InstanceOptions(void);
866 };
867
868}
869
871
872namespace Gecode { namespace Driver {
873
881 template<class BaseSpace>
882 class ScriptBase : public BaseSpace {
883 public:
885 ScriptBase(const Options& opt);
889 virtual void print(std::ostream& os) const;
891 virtual void compare(const Space& home, std::ostream& os) const;
893 static std::ostream& select_ostream(const char* sn, std::ofstream& ofs);
903 template<class Script, template<class> class Engine, class Options>
904 static void run(const Options& opt, Script* s=nullptr);
905 private:
906 template<class Script, template<class> class Engine, class Options,
907 template<class, template<class> class> class Meta>
908 static void runMeta(const Options& opt, Script* s);
909 };
910
911#ifdef GECODE_HAS_FLOAT_VARS
912
914 template<class BaseSpace>
915 class ExtractStepOption : public BaseSpace {
916 public:
919 : BaseSpace(opt.step()) {}
920
921 ExtractStepOption(BaseSpace& e)
922 : BaseSpace(e) {}
923 };
924
925#endif
926
928 template<class BaseSpace>
929 class IgnoreStepOption : public BaseSpace {
930 public:
934 IgnoreStepOption(BaseSpace& e)
935 : BaseSpace(e) {}
936 };
937
938}}
939
941
942namespace Gecode {
943
948
955
968
981
982#ifdef GECODE_HAS_FLOAT_VARS
983
996
997#endif
998
999}
1000
1001#endif
1002
1003// STATISTICS: driver-any
Base class for script options.
Definition driver.hh:391
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: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: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:123
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:126
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:128
const char * iopt
String for option (including hyphen).
Definition driver.hh:127
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:129
Boolean option.
Definition driver.hh:305
bool cur
Current value.
Definition driver.hh:307
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:287
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:921
ExtractStepOption(const Options &opt)
Constructor that extracts the step value.
Definition driver.hh:918
IgnoreStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:934
IgnoreStepOption(const Options &)
Constructor.
Definition driver.hh:932
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:226
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: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.
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:368
unsigned int cur_port
Current port.
Definition driver.hh:367
virtual void help(void)
Print help text.
Parametric base-class for scripts.
Definition driver.hh:882
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.
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
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
int cur
Current value.
Definition driver.hh:199
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:201
Value * fst
First option value.
Definition driver.hh:200
virtual void help(void)
Print help text.
String-valued option.
Definition driver.hh:153
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:155
Trace flag option.
Definition driver.hh:345
int cur
Current value.
Definition driver.hh:347
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: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
unsigned int cur
Current value.
Definition driver.hh:246
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:264
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
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
bool builtin(unsigned int &i) const
Test whether the instance is the number of a built-in instance.
const char * _inst
Instance string.
Definition driver.hh:802
bool is_file(void) const
Test whether the instance names a readable file.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
void instance(const char *s)
Set default instance name.
Driver::StringListOption _param
Parameters for the spec.
Definition driver.hh:805
void forget(void) const
const char * _spec
Reader spec for instance files.
Definition driver.hh:803
Instance::Data data(void) const
Read the instance file.
void param(const char *p)
Set the spec parameters (name=value, separated by commas).
void spec_file(const char *f)
Set the file with a reader spec that replaces spec().
std::unique_ptr< Instance::Data > _data
Data read, or null Forget the data read.
Definition driver.hh:806
virtual void help(void)
Print help text.
InstanceOptions(const char *s)
Initialize options for script with name s.
void spec(const char *s)
Set the reader spec for instance files.
Driver::StringValueOption _spec_file
File with a reader spec.
Definition driver.hh:804
Named values read from an instance.
Definition instance.hh:406
I_(void)
Constructor.
Definition options.hpp:583
void compare(Gist::Comparator *i)
Add comparator.
Definition options.hpp:600
void click(Gist::Inspector *i)
Add inspector that reacts on node double clicks.
Definition options.hpp:588
void move(Gist::Inspector *i)
Add inspector that reacts on each move of the cursor.
Definition options.hpp:596
void solution(Gist::Inspector *i)
Add inspector that reacts on each new solution that is found.
Definition options.hpp:592
Options for scripts
Definition driver.hh:426
Driver::DoubleOption _relax
Probability to relax variable.
Definition driver.hh:463
void trace(int f)
Set trace flags.
Definition options.hpp:548
Driver::StringValueOption _log_file
Where to print statistics.
Definition driver.hh:478
void c_d(unsigned int d)
Set default copy recomputation distance.
Definition options.hpp:341
Driver::StringOption _model
General model options.
Definition driver.hh:430
void log_file(const char *f)
Set default output file name for Gecode stats.
Definition options.hpp:538
void print_last(bool p)
Set whether to print only last solution found.
Definition options.hpp:519
Driver::StringOption _mode
Script mode to run.
Definition driver.hh:473
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:510
Driver::DoubleOption _decay
Decay option.
Definition driver.hh:435
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Definition driver.hh:462
void a_d(unsigned int d)
Set default adaptive recomputation distance.
Definition options.hpp:350
void profiler_id(int i)
Set profiler execution identifier.
Definition options.hpp:564
void seed(unsigned int s)
Set default seed value.
Definition options.hpp:276
Driver::BoolOption _nogoods
Whether to use no-goods.
Definition driver.hh:461
void branching(int v)
Set default branching value.
Definition options.hpp:254
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
Definition driver.hh:455
Driver::UnsignedLongLongIntOption _r_limit
Cutoff for number of restarts.
Definition driver.hh:460
Driver::TraceOption _trace
Trace flags for tracing.
Definition driver.hh:479
Driver::UnsignedLongLongIntOption _fail
Cutoff for number of failures.
Definition driver.hh:452
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Definition driver.hh:448
void slice(unsigned int n)
Set default slice size in a portfolio.
Definition options.hpp:404
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
Definition driver.hh:454
void search(int v)
Set default search value.
Definition options.hpp:299
Driver::UnsignedLongLongIntOption _node
Cutoff for number of nodes.
Definition driver.hh:450
void nogoods(bool b)
Set default nogoods posting behavior.
Definition options.hpp:449
void symmetry(int v)
Set default symmetry value.
Definition options.hpp:219
void profiler_port(unsigned int p)
Set profiler port.
Definition options.hpp:572
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Definition driver.hh:475
Driver::StringOption _search
Search options.
Definition driver.hh:442
Driver::StringOption _propagation
Propagation options.
Definition driver.hh:432
Driver::IplOption _ipl
Integer propagation level.
Definition driver.hh:433
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:413
Driver::UnsignedLongLongIntOption _solutions
How many solutions.
Definition driver.hh:444
Options(const char *s)
Initialize options for script with name s.
Driver::BoolOption _print_last
Print only last solution found.
Definition driver.hh:476
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition driver.hh:446
void nogoods_limit(unsigned int l)
Set default nogoods depth limit.
Definition options.hpp:458
void step(double s)
Set default step value.
Definition options.hpp:285
const Search::HeuristicGuidance * _guidance
Guidance for heuristic search.
Definition driver.hh:467
Driver::ProfilerOption _profiler
Options for the CP Profiler.
Definition driver.hh:482
void relax(double d)
Set default relax probability.
Definition options.hpp:467
void ipl(IntPropLevel i)
Set default integer propagation level.
Definition options.hpp:245
Driver::DoubleOption _threads
How many threads to use.
Definition driver.hh:445
Driver::StringOption _branching
Branching options.
Definition driver.hh:434
Driver::StringOption _restart
Restart method option.
Definition driver.hh:456
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:395
Driver::UnsignedIntOption _seed
Seed option.
Definition driver.hh:436
Driver::DoubleOption _step
Step option.
Definition driver.hh:437
void time(double t)
Set default time cutoff.
Definition options.hpp:386
Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition driver.hh:458
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:453
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:431
void interrupt(bool b)
Set default interrupt behavior.
Definition options.hpp:478
void restart_base(double base)
Set default restart base.
Definition options.hpp:422
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition driver.hh:464
void d_l(unsigned int d)
Set default discrepancy limit for LDS.
Definition options.hpp:359
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:447
void samples(unsigned int s)
Set default number of samples.
Definition options.hpp:501
void out_file(const char *f)
Set default output file name for solutions.
Definition options.hpp:528
Driver::DoubleOption _r_base
Restart base.
Definition driver.hh:457
Driver::StringOption _symmetry
General symmetry options.
Definition driver.hh:431
void guidance(const Search::HeuristicGuidance *g)
Set guidance for heuristic search (not copied).
Definition options.hpp:331
Driver::StringValueOption _out_file
Where to print solutions.
Definition driver.hh:477
Driver::UnsignedIntOption _samples
How many samples.
Definition driver.hh:474
void node(unsigned long long int n)
Set default node cutoff.
Definition options.hpp:368
void mode(ScriptMode em)
Set default mode.
Definition options.hpp:492
void fail(unsigned long long int n)
Set default failure cutoff.
Definition options.hpp:377
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:440
Guidance for heuristic search engines (experimental).
Definition search.hh:1259
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:755
void size(unsigned int s)
Set default size.
Definition options.hpp:626
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Computation spaces.
Definition core.hpp:1782
Array with arbitrary number of elements.
#define GECODE_DRIVER_EXPORT
Definition driver.hh:64
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:967
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:954
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Definition driver.hh:989
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
Definition driver.hh:995
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMaximizeSpace > > IntLexMaximizeScript
Base-class for scripts for finding solution of lexically highest integer costs.
Definition driver.hh:980
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMinimizeSpace > > IntLexMinimizeScript
Base-class for scripts for finding solution of lexically lowest integer costs.
Definition driver.hh:974
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Definition driver.hh:961
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:1274
@ IPL_DEF
Simple propagation levels.
Definition int.hh:1276
Gecode toplevel namespace