38 #ifndef __GECODE_DRIVER_HH__ 39 #define __GECODE_DRIVER_HH__ 43 #ifdef GECODE_HAS_GIST 51 #if !defined(GECODE_STATIC_LIBS) && \ 52 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER)) 54 #ifdef GECODE_BUILD_DRIVER 55 #define GECODE_DRIVER_EXPORT __declspec( dllexport ) 57 #define GECODE_DRIVER_EXPORT __declspec( dllimport ) 62 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY 63 #define GECODE_DRIVER_EXPORT __attribute__ ((visibility("default"))) 65 #define GECODE_DRIVER_EXPORT 71 #ifndef GECODE_BUILD_DRIVER 72 #define GECODE_LIBRARY_NAME "Driver" 130 char* argument(
int argc,
char* argv[])
const;
136 virtual int parse(
int argc,
char* argv[]) = 0;
138 virtual void help(
void) = 0;
142 static char* strdup(
const char* s);
144 static void strdel(
const char* s);
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);
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);
214 IntOption(
const char* o,
const char* e,
int v=0);
218 int value(
void)
const;
220 virtual int parse(
int argc,
char* argv[]);
222 virtual void help(
void);
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);
256 void value(
double v);
258 double value(
void)
const;
260 virtual int parse(
int argc,
char* argv[]);
262 virtual void help(
void);
274 BoolOption(
const char* o,
const char* e,
bool v=
false);
278 bool value(
void)
const;
280 virtual int parse(
int argc,
char* argv[]);
282 virtual void help(
void);
300 virtual int parse(
int argc,
char* argv[]);
302 virtual void help(
void);
318 int value(
void)
const;
320 virtual int parse(
int argc,
char* argv[]);
322 virtual void help(
void);
340 virtual void help(
void);
351 void parse(
int& argc,
char* argv[]);
354 const char* name(
void)
const;
356 void name(
const char*);
422 void model(
int v,
const char* o,
const char* h = NULL);
424 int model(
void)
const;
427 void symmetry(
int v);
429 void symmetry(
int v,
const char* o,
const char* h = NULL);
431 int symmetry(
void)
const;
434 void propagation(
int v);
436 void propagation(
int v,
const char* o,
const char* h = NULL);
438 int propagation(
void)
const;
446 void branching(
int v);
448 void branching(
int v,
const char* o,
const char* h = NULL);
450 int branching(
void)
const;
453 void decay(
double d);
455 double decay(
void)
const;
458 void seed(
unsigned int s);
460 unsigned int seed(
void)
const;
465 double step(
void)
const;
473 void search(
int v,
const char* o,
const char* h = NULL);
475 int search(
void)
const;
488 void c_d(
unsigned int d);
490 unsigned int c_d(
void)
const;
493 void a_d(
unsigned int d);
495 unsigned int a_d(
void)
const;
498 void d_l(
unsigned int d);
500 unsigned int d_l(
void)
const;
503 void node(
unsigned int n);
505 unsigned int node(
void)
const;
508 void fail(
unsigned int n);
510 unsigned int fail(
void)
const;
513 void time(
unsigned int t);
515 unsigned int time(
void)
const;
518 void assets(
unsigned int n);
520 unsigned int assets(
void)
const;
523 void slice(
unsigned int n);
525 unsigned int slice(
void)
const;
533 void restart_base(
double base);
535 double restart_base(
void)
const;
538 void restart_scale(
unsigned int scale);
540 unsigned int restart_scale(
void)
const;
543 void nogoods(
bool b);
545 bool nogoods(
void)
const;
555 double relax(
void)
const;
558 void interrupt(
bool b);
560 bool interrupt(
void)
const;
571 void samples(
unsigned int s);
573 unsigned int samples(
void)
const;
576 void iterations(
unsigned int i);
578 unsigned int iterations(
void)
const;
581 void print_last(
bool p);
583 bool print_last(
void)
const;
586 void out_file(
const char* f);
588 const char* out_file(
void)
const;
591 void log_file(
const char* f);
593 const char* log_file(
void)
const;
598 int trace(
void)
const;
601 #ifdef GECODE_HAS_GIST 608 unsigned int n_click;
612 unsigned int n_solution;
620 unsigned int n_compare;
656 virtual void help(
void);
658 void parse(
int& argc,
char* argv[]);
661 void size(
unsigned int s);
663 unsigned int size(
void)
const;
677 virtual void help(
void);
679 void parse(
int& argc,
char* argv[]);
682 void instance(
const char* s);
684 const char* instance(
void)
const;
693 namespace Gecode {
namespace Driver {
702 template<
class BaseSpace>
710 virtual void print(std::ostream& os)
const;
712 virtual void compare(
const Space& home, std::ostream& os)
const;
714 static std::ostream& select_ostream(
const char* sn, std::ofstream& ofs);
724 template<
class Script,
template<
class>
class Engine,
class Options>
727 template<
class Script,
template<
class>
class Engine,
class Options,
728 template<
class,
template<
class>
class>
class Meta>
729 static void runMeta(const Options&
opt,
Script* s);
734 #ifdef GECODE_HAS_FLOAT_VARS 737 template<
class BaseSpace>
742 : BaseSpace(opt.
step()) {}
745 : BaseSpace(share,e) {}
751 template<
class BaseSpace>
758 : BaseSpace(share,e) {}
804 #ifdef GECODE_HAS_FLOAT_VARS Driver::ScriptBase< Driver::IgnoreStepOption< MaximizeSpace > > MaximizeScript
Base-class for scripts for finding solution of highest integer cost.
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Restart with linear sequence.
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Options for scripts with additional size parameter
const Gecode::FloatNum step
Helper class storing Gist inspectors.
Driver::ScriptBase< Driver::IgnoreStepOption< MinimizeSpace > > MinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Driver::DoubleOption _decay
Decay option.
unsigned int cur
Current value.
Driver::DoubleOption _step
Step option.
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
ScriptMode
Different modes for executing scripts.
const char * exp
Short explanation.
Value * next
Next option value.
const char * opt
String for option value.
Abstract base class for comparators.
Driver::DoubleOption _threads
How many threads to use.
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Driver::StringOption _restart
Restart method option.
Driver::BoolOption _nogoods
Whether to use no-goods.
Class to ignore the step option value.
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Value * lst
Last option value.
Array with arbitrary number of elements.
Restart with Luby sequence.
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
IgnoreStepOption(bool share, BaseSpace &e)
Constructor used for cloning.
Driver::DoubleOption _r_base
Restart base.
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
RestartMode
Different modes for restart-based search.
Abstract base class for inspectors.
Parametric base-class for scripts.
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, FznRnd *rnd=NULL)
Parse FlatZinc file fileName into fzs and return it.
Driver::StringOption _model
General model options.
unsigned int _size
Size value.
Integer propagation level option.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Print solution and some statistics.
const char * help
Optional help text.
Driver::UnsignedIntOption _samples
How many samples.
Driver::StringValueOption _log_file
Where to print statistics.
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Simple propagation levels.
Value * fst
First option value.
Driver::StringOption _propagation
Propagation options.
Base class for script options.
const char * _name
Script name.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Driver::StringOption _search
Search options.
Driver::BoolOption _print_last
Print only last solution found.
BaseOption * next
Next option Check for option and return its argument.
const unsigned int d_l
Default discrepancy limit for LDS.
#define GECODE_DRIVER_EXPORT
Driver::StringOption _symmetry
General symmetry options.
Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Driver::UnsignedIntOption _time
Cutoff for time.
Driver::StringOption _mode
Script mode to run.
const double threads
Number of threads to use.
int val
Value for an option value.
Driver::DoubleOption _relax
Probability to relax variable.
String-valued option (integer value defined by strings)
IntPropLevel
Propagation levels for integer propagators.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
Driver::ScriptBase< Driver::IgnoreStepOption< IntMaximizeSpace > > IntMaximizeScript
Base-class for scripts for finding solution of highest integer cost.
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
const double base
Base for geometric restart sequence.
Print statistics for script.
Options for scripts with additional instance parameter
Driver::TraceOption _trace
Trace flags for tracing.
Restart with geometric sequence.
const char * opt
String for option (including hyphen)
Driver::StringValueOption _out_file
Where to print solutions.
Driver::BaseOption * fst
First registered option.
const char * _inst
Instance string.
Driver::UnsignedIntOption _solutions
How many solutions.
Driver::StringOption _branching
Branching options.
IntPropLevel cur
Current value.
const char * cur
Current value.
Driver::BaseOption * lst
Last registered option.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
CompareStatus compare(I &i, J &j)
Check whether range iterator i is a subset of j, or whether they are disjoint.
Driver::IplOption _ipl
Integer propagation level.
Gecode toplevel namespace
Driver::UnsignedIntOption _seed
Seed option.
IgnoreStepOption(const Options &)
Constructor.
const unsigned int nogoods_limit
Depth limit for no-good generation during search.
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
Restart with constant sequence.
Driver::UnsignedIntOption _r_scale
Restart scale factor.
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures) ...
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Driver::UnsignedIntOption _node
Cutoff for number of nodes.
int solutions(TestSpace *c, Gecode::Search::Options &o, int maxNbSol=-1)
Find number of solutions.
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
virtual void help(void)
Print help text.