Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.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.org>
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.org
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
101
113
114 class BaseOptions;
115
116 namespace Driver {
123 protected:
124 const char* eopt;
125 const char* iopt;
126 const char* exp;
129 char* argument(int argc, char* argv[]) const;
130 public:
132 BaseOption(const char* o, const char* e);
134 virtual int parse(int argc, char* argv[]) = 0;
136 virtual void help(void) = 0;
138 virtual ~BaseOption(void);
140 static char* strdup(const char* s);
142 static char* stredup(const char* s);
144 static void strdel(const char* s);
145 };
146
152 protected:
153 const char* cur;
154 public:
156 StringValueOption(const char* o, const char* e, const char* v=NULL);
158 void value(const char* v);
160 const char* value(void) const;
162 virtual int parse(int argc, char* argv[]);
164 virtual void help(void);
166 virtual ~StringValueOption(void);
167 };
168
169
175 protected:
177 class Value {
178 public:
179 int val;
180 const char* opt;
181 const char* help;
183 };
184 int cur;
187 public:
189 StringOption(const char* o, const char* e, int v=0);
191 void value(int v);
193 int value(void) const;
195 void add(int v, const char* o, const char* h = NULL);
197 virtual int parse(int argc, char* argv[]);
199 virtual void help(void);
201 virtual ~StringOption(void);
202 };
203
204
210 protected:
211 int cur;
212 public:
214 IntOption(const char* o, const char* e, int v=0);
216 void value(int v);
218 int value(void) const;
220 virtual int parse(int argc, char* argv[]);
222 virtual void help(void);
223 };
224
230 protected:
231 unsigned int cur;
232 public:
234 UnsignedIntOption(const char* o, const char* e, unsigned int v=0);
236 void value(unsigned int v);
238 unsigned int value(void) const;
240 virtual int parse(int argc, char* argv[]);
242 virtual void help(void);
243 };
244
250 protected:
251 double cur;
252 public:
254 DoubleOption(const char* o, const char* e, double v=0);
256 void value(double v);
258 double value(void) const;
260 virtual int parse(int argc, char* argv[]);
262 virtual void help(void);
263 };
264
270 protected:
271 bool cur;
272 public:
274 BoolOption(const char* o, const char* e, bool v=false);
276 void value(bool v);
278 bool value(void) const;
280 virtual int parse(int argc, char* argv[]);
282 virtual void help(void);
283 };
284
290 protected:
292 public:
296 void value(IntPropLevel l);
298 IntPropLevel value(void) const;
300 virtual int parse(int argc, char* argv[]);
302 virtual void help(void);
303 };
304
310 protected:
311 int cur;
312 public:
314 TraceOption(int f=0);
316 void value(int f);
318 int value(void) const;
320 virtual int parse(int argc, char* argv[]);
322 virtual void help(void);
323 };
324
325 }
326
332 protected:
335 const char* _name;
336 public:
338 BaseOptions(const char* s);
340 virtual void help(void);
341
343 void add(Driver::BaseOption& o);
351 void parse(int& argc, char* argv[]);
352
354 const char* name(void) const;
356 void name(const char*);
357
359 virtual ~BaseOptions(void);
360 };
361
367 protected:
369
379
381
401
403
411
412#ifdef GECODE_HAS_CPPROFILER
416#endif
417
419
420 public:
422 Options(const char* s);
423
425
426
427 void model(int v);
429 void model(int v, const char* o, const char* h = NULL);
431 int model(void) const;
432
434 void symmetry(int v);
436 void symmetry(int v, const char* o, const char* h = NULL);
438 int symmetry(void) const;
439
441 void propagation(int v);
443 void propagation(int v, const char* o, const char* h = NULL);
445 int propagation(void) const;
446
448 void ipl(IntPropLevel i);
450 IntPropLevel ipl(void) const;
451
453 void branching(int v);
455 void branching(int v, const char* o, const char* h = NULL);
457 int branching(void) const;
458
460 void decay(double d);
462 double decay(void) const;
463
465 void seed(unsigned int s);
467 unsigned int seed(void) const;
468
470 void step(double s);
472 double step(void) const;
474
476
477
478 void search(int v);
480 void search(int v, const char* o, const char* h = NULL);
482 int search(void) const;
483
485 void solutions(unsigned int n);
487 unsigned int solutions(void) const;
488
490 void threads(double n);
492 double threads(void) const;
493
495 void c_d(unsigned int d);
497 unsigned int c_d(void) const;
498
500 void a_d(unsigned int d);
502 unsigned int a_d(void) const;
503
505 void d_l(unsigned int d);
507 unsigned int d_l(void) const;
508
510 void node(unsigned int n);
512 unsigned int node(void) const;
513
515 void fail(unsigned int n);
517 unsigned int fail(void) const;
518
520 void time(unsigned int t);
522 unsigned int time(void) const;
523
525 void assets(unsigned int n);
527 unsigned int assets(void) const;
528
530 void slice(unsigned int n);
532 unsigned int slice(void) const;
533
535 void restart(RestartMode r);
537 RestartMode restart(void) const;
538
540 void restart_base(double base);
542 double restart_base(void) const;
543
545 void restart_scale(unsigned int scale);
547 unsigned int restart_scale(void) const;
548
550 void nogoods(bool b);
552 bool nogoods(void) const;
553
555 void nogoods_limit(unsigned int l);
557 unsigned int nogoods_limit(void) const;
558
560 void relax(double d);
562 double relax(void) const;
563
565 void interrupt(bool b);
567 bool interrupt(void) const;
569
571
572
573 void mode(ScriptMode em);
575 ScriptMode mode(void) const;
576
578 void samples(unsigned int s);
580 unsigned int samples(void) const;
581
583 void iterations(unsigned int i);
585 unsigned int iterations(void) const;
586
588 void print_last(bool p);
590 bool print_last(void) const;
591
593 void out_file(const char* f);
595 const char* out_file(void) const;
596
598 void log_file(const char* f);
600 const char* log_file(void) const;
601
603 void trace(int f);
605 int trace(void) const;
606
607#ifdef GECODE_HAS_CPPROFILER
609 void profiler_id(int i);
611 int profiler_id(void) const;
613 void profiler_port(unsigned int p);
615 unsigned int profiler_port(void) const;
617 void profiler_info(bool b);
619 bool profiler_info(void) const;
620#endif
622
623#ifdef GECODE_HAS_GIST
625 class _I {
626 private:
630 unsigned int n_click;
634 unsigned int n_solution;
638 unsigned int n_move;
642 unsigned int n_compare;
643 public:
645 _I(void);
647 void click(Gist::Inspector* i);
649 void solution(Gist::Inspector* i);
651 void move(Gist::Inspector* i);
653 void compare(Gist::Comparator* i);
654
656 Gist::Inspector* click(unsigned int i) const;
658 Gist::Inspector* solution(unsigned int i) const;
660 Gist::Inspector* move(unsigned int i) const;
662 Gist::Comparator* compare(unsigned int i) const;
663 } inspect;
664#endif
665 };
666
667}
668
669namespace Gecode {
670
676 protected:
677 unsigned int _size;
678 public:
680 SizeOptions(const char* s);
682 virtual void help(void);
684 void parse(int& argc, char* argv[]);
685
687 void size(unsigned int s);
689 unsigned int size(void) const;
690 };
691
697 protected:
698 const char* _inst;
699 public:
701 InstanceOptions(const char* s);
703 virtual void help(void);
705 void parse(int& argc, char* argv[]);
706
708 void instance(const char* s);
710 const char* instance(void) const;
712 ~InstanceOptions(void);
713 };
714
715}
716
718
719namespace Gecode { namespace Driver {
720
728 template<class BaseSpace>
729 class ScriptBase : public BaseSpace {
730 public:
732 ScriptBase(const Options& opt);
736 virtual void print(std::ostream& os) const;
738 virtual void compare(const Space& home, std::ostream& os) const;
740 static std::ostream& select_ostream(const char* sn, std::ofstream& ofs);
750 template<class Script, template<class> class Engine, class Options>
751 static void run(const Options& opt, Script* s=NULL);
752 private:
753 template<class Script, template<class> class Engine, class Options,
754 template<class, template<class> class> class Meta>
755 static void runMeta(const Options& opt, Script* s);
756 };
757
758#ifdef GECODE_HAS_FLOAT_VARS
759
761 template<class BaseSpace>
762 class ExtractStepOption : public BaseSpace {
763 public:
766 : BaseSpace(opt.step()) {}
767
768 ExtractStepOption(BaseSpace& e)
769 : BaseSpace(e) {}
770 };
771
772#endif
773
775 template<class BaseSpace>
776 class IgnoreStepOption : public BaseSpace {
777 public:
781 IgnoreStepOption(BaseSpace& e)
782 : BaseSpace(e) {}
783 };
784
785}}
786
788
789namespace Gecode {
790
795
802
815
828
829#ifdef GECODE_HAS_FLOAT_VARS
830
843
844#endif
845
846}
847
848#endif
849
850// STATISTICS: driver-any
Base class for script options.
Definition driver.hh:331
BaseOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:483
void add(Driver::BaseOption &o)
Add new option o.
Definition options.cpp:474
const char * _name
Script name.
Definition driver.hh:335
Driver::BaseOption * fst
First registered option.
Definition driver.hh:333
Driver::BaseOption * lst
Last registered option.
Definition driver.hh:334
const char * name(void) const
Return name of script.
Definition options.hpp:166
virtual void help(void)
Print help text.
Definition options.cpp:494
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition options.cpp:548
Base class for options.
Definition driver.hh:121
static void strdel(const char *s)
Delete heap-allocated copy of string s.
Definition options.cpp:71
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:61
const char * eopt
String for option (excluding hyphen)
Definition driver.hh:124
char * argument(int argc, char *argv[]) const
Definition options.cpp:78
static char * strdup(const char *s)
Create heap-allocated copy of string s.
Definition options.cpp:52
const char * exp
Short explanation.
Definition driver.hh:126
const char * iopt
String for option (including hyphen)
Definition driver.hh:125
BaseOption(const char *o, const char *e)
Initialize for option o and explanation e.
Definition options.cpp:99
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:127
Boolean option.
Definition driver.hh:269
bool 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.
Definition options.cpp:249
BoolOption(const char *o, const char *e, bool v=false)
Initialize for option o and explanation e and default value v.
Definition options.hpp:121
void value(bool v)
Set default value to v.
Definition options.hpp:124
virtual void help(void)
Print help text.
Definition options.cpp:281
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:232
double cur
Current value.
Definition driver.hh:251
virtual void help(void)
Print help text.
Definition options.cpp:241
DoubleOption(const char *o, const char *e, double v=0)
Initialize for option o and explanation e and default value v.
Definition options.hpp:104
void value(double v)
Set default value to v.
Definition options.hpp:108
ExtractStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:768
ExtractStepOption(const Options &opt)
Constructor that extracts the step value.
Definition driver.hh:765
IgnoreStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:781
IgnoreStepOption(const Options &)
Constructor.
Definition driver.hh:779
Integer option.
Definition driver.hh:209
virtual void help(void)
Print help text.
Definition options.cpp:208
void value(int v)
Set default value to v.
Definition options.hpp:74
int cur
Current value.
Definition driver.hh:211
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:199
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:289
IntPropLevel cur
Current value.
Definition driver.hh:291
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:297
IplOption(IntPropLevel ipl=IPL_DEF)
Initialize with default value ipl.
Definition options.cpp:292
virtual void help(void)
Print help text.
Definition options.cpp:331
void value(IntPropLevel l)
Set default level to l.
Definition options.hpp:137
Parametric base-class for scripts.
Definition driver.hh:729
static void run(const Options &opt, Script *s=NULL)
Definition script.hpp:290
ScriptBase(ScriptBase &e)
Constructor used for cloning.
Definition script.hpp:234
virtual void compare(const Space &home, std::ostream &os) const
Compare with s.
Definition script.hpp:243
virtual void print(std::ostream &os) const
Print a solution to os.
Definition script.hpp:239
static std::ostream & select_ostream(const char *sn, std::ofstream &ofs)
Choose output stream according to sn.
Definition script.hpp:247
ScriptBase(const Options &opt)
Constructor.
Definition script.hpp:229
const char * help
Optional help text.
Definition driver.hh:181
Value * next
Next option value.
Definition driver.hh:182
int val
Value for an option value.
Definition driver.hh:179
const char * opt
String for option value.
Definition driver.hh:180
String-valued option (integer value defined by strings)
Definition driver.hh:174
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:152
int cur
Current value.
Definition driver.hh:184
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:167
void value(int v)
Set default value to v.
Definition options.hpp:58
Value * lst
Last option value.
Definition driver.hh:186
Value * fst
First option value.
Definition driver.hh:185
void add(int v, const char *o, const char *h=NULL)
Add option value for value v, string o, and help text h.
Definition options.cpp:138
String-valued option.
Definition driver.hh:151
virtual void help(void)
Print help text.
Definition options.cpp:126
void value(const char *v)
Set default value to v.
Definition options.cpp:113
StringValueOption(const char *o, const char *e, const char *v=NULL)
Initialize for option o and explanation e and default value v.
Definition options.cpp:109
const char * cur
Current value.
Definition driver.hh:153
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:118
Trace flag option.
Definition driver.hh:309
virtual void help(void)
Print help text.
Definition options.cpp:412
int cur
Current value.
Definition driver.hh:311
TraceOption(int f=0)
Initialize with no tracing.
Definition options.cpp:353
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:358
void value(int f)
Set default trace flags to f.
Definition options.hpp:151
Unsigned integer option.
Definition driver.hh:229
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:215
unsigned int cur
Current value.
Definition driver.hh:231
virtual void help(void)
Print help text.
Definition options.cpp:224
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:698
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition options.cpp:700
void instance(const char *s)
Set default instance name.
Definition options.cpp:687
virtual void help(void)
Print help text.
Definition options.cpp:693
InstanceOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:683
void click(Gist::Inspector *i)
Add inspector that reacts on node double clicks.
Definition options.hpp:548
void solution(Gist::Inspector *i)
Add inspector that reacts on each new solution that is found.
Definition options.hpp:552
void move(Gist::Inspector *i)
Add inspector that reacts on each move of the cursor.
Definition options.hpp:556
_I(void)
Constructor.
Definition options.hpp:543
void compare(Gist::Comparator *i)
Add comparator.
Definition options.hpp:560
Options for scripts
Definition driver.hh:366
Driver::DoubleOption _relax
Probability to relax variable.
Definition driver.hh:398
void trace(int f)
Set trace flags.
Definition options.hpp:499
Driver::StringValueOption _log_file
Where to print statistics.
Definition driver.hh:409
void c_d(unsigned int d)
Set default copy recomputation distance.
Definition options.hpp:301
Driver::StringOption _model
General model options.
Definition driver.hh:370
void log_file(const char *f)
Set default output file name for Gecode stats.
Definition options.hpp:489
void print_last(bool p)
Set whether to print only last solution found.
Definition options.hpp:470
Driver::StringOption _mode
Script mode to run.
Definition driver.hh:404
void propagation(int v)
Set default propagation value.
Definition options.hpp:203
void iterations(unsigned int i)
Set default number of iterations.
Definition options.hpp:461
Driver::DoubleOption _decay
Decay option.
Definition driver.hh:375
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Definition driver.hh:397
void a_d(unsigned int d)
Set default adaptive recomputation distance.
Definition options.hpp:310
void profiler_id(int i)
Set profiler execution identifier.
Definition options.hpp:515
void seed(unsigned int s)
Set default seed value.
Definition options.hpp:247
Driver::BoolOption _nogoods
Whether to use no-goods.
Definition driver.hh:396
void branching(int v)
Set default branching value.
Definition options.hpp:225
void fail(unsigned int n)
Set default failure cutoff.
Definition options.hpp:337
void solutions(unsigned int n)
Set default number of solutions to search for.
Definition options.hpp:283
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
Definition driver.hh:392
Driver::TraceOption _trace
Trace flags for tracing.
Definition driver.hh:410
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Definition driver.hh:387
void slice(unsigned int n)
Set default slice size in a portfolio.
Definition options.hpp:364
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
Definition driver.hh:391
void search(int v)
Set default search value.
Definition options.hpp:270
Driver::UnsignedIntOption _solutions
How many solutions.
Definition driver.hh:383
void nogoods(bool b)
Set default nogoods posting behavior.
Definition options.hpp:400
void symmetry(int v)
Set default symmetry value.
Definition options.hpp:190
void profiler_port(unsigned int p)
Set profiler port.
Definition options.hpp:523
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Definition driver.hh:406
Driver::StringOption _search
Search options.
Definition driver.hh:382
Driver::StringOption _propagation
Propagation options.
Definition driver.hh:372
Driver::IplOption _ipl
Integer propagation level.
Definition driver.hh:373
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:373
Options(const char *s)
Initialize options for script with name s.
Definition options.cpp:576
Driver::BoolOption _profiler_info
Whether solution information should be sent to the CPProfiler.
Definition driver.hh:415
Driver::BoolOption _print_last
Print only last solution found.
Definition driver.hh:407
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition driver.hh:385
void nogoods_limit(unsigned int l)
Set default nogoods depth limit.
Definition options.hpp:409
void step(double s)
Set default step value.
Definition options.hpp:256
void relax(double d)
Set default relax probability.
Definition options.hpp:418
void ipl(IntPropLevel i)
Set default integer propagation level.
Definition options.hpp:216
Driver::DoubleOption _threads
How many threads to use.
Definition driver.hh:384
Driver::StringOption _branching
Branching options.
Definition driver.hh:374
Driver::StringOption _restart
Restart method option.
Definition driver.hh:393
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:355
Driver::UnsignedIntOption _seed
Seed option.
Definition driver.hh:376
Driver::UnsignedIntOption _time
Cutoff for time.
Definition driver.hh:390
Driver::DoubleOption _step
Step option.
Definition driver.hh:377
Driver::UnsignedIntOption _profiler_port
Connect to this port.
Definition driver.hh:414
Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition driver.hh:395
Driver::IntOption _profiler_id
Use this execution id for the CP-profiler.
Definition driver.hh:413
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:391
void profiler_info(bool b)
Whether solution info should be sent to profiler.
Definition options.hpp:531
void interrupt(bool b)
Set default interrupt behavior.
Definition options.hpp:429
void restart_base(double base)
Set default restart base.
Definition options.hpp:382
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition driver.hh:399
void d_l(unsigned int d)
Set default discrepancy limit for LDS.
Definition options.hpp:319
void model(int v)
Set default model value.
Definition options.hpp:177
void decay(double d)
Set default decay factor.
Definition options.hpp:238
Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition driver.hh:386
void node(unsigned int n)
Set default node cutoff.
Definition options.hpp:328
void samples(unsigned int s)
Set default number of samples.
Definition options.hpp:452
void out_file(const char *f)
Set default output file name for solutions.
Definition options.hpp:479
Driver::DoubleOption _r_base
Restart base.
Definition driver.hh:394
Driver::StringOption _symmetry
General symmetry options.
Definition driver.hh:371
void time(unsigned int t)
Set default time cutoff.
Definition options.hpp:346
Driver::StringValueOption _out_file
Where to print solutions.
Definition driver.hh:408
Driver::UnsignedIntOption _node
Cutoff for number of nodes.
Definition driver.hh:388
Driver::UnsignedIntOption _samples
How many samples.
Definition driver.hh:405
void mode(ScriptMode em)
Set default mode.
Definition options.hpp:443
Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Definition driver.hh:389
void threads(double n)
Set number of parallel threads.
Definition options.hpp:292
virtual void help(void)
Print help text.
Definition options.cpp:667
SizeOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:663
unsigned int _size
Size value.
Definition driver.hh:677
void size(unsigned int s)
Set default size.
Definition options.hpp:586
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition options.cpp:674
Computation spaces.
Definition core.hpp:1744
Array with arbitrary number of elements.
#define GECODE_DRIVER_EXPORT
Definition driver.hh:61
ScriptMode
Different modes for executing scripts.
Definition driver.hh:94
RestartMode
Different modes for restart-based search.
Definition driver.hh:106
@ 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_CPPROFILER
Run script with CP-profiler.
Definition driver.hh:99
@ SM_TIME
Measure average runtime.
Definition driver.hh:96
@ RM_CONSTANT
Restart with constant sequence.
Definition driver.hh:108
@ RM_LINEAR
Restart with linear sequence.
Definition driver.hh:109
@ RM_LUBY
Restart with Luby sequence.
Definition driver.hh:110
@ RM_NONE
No restarts.
Definition driver.hh:107
@ RM_GEOMETRIC
Restart with geometric sequence.
Definition driver.hh:111
Driver::ScriptBase< Driver::IgnoreStepOption< IntMaximizeSpace > > IntMaximizeScript
Base-class for scripts for finding solution of highest integer cost.
Definition driver.hh:814
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:801
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Definition driver.hh:836
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
Definition driver.hh:842
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMaximizeSpace > > IntLexMaximizeScript
Base-class for scripts for finding solution of lexically highest integer costs.
Definition driver.hh:827
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMinimizeSpace > > IntLexMinimizeScript
Base-class for scripts for finding solution of lexically lowest integer costs.
Definition driver.hh:821
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Definition driver.hh:808
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:989
@ IPL_DEF
Simple propagation levels.
Definition int.hh:991
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:773