driver.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2009
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_DRIVER_HH__
#define __GECODE_DRIVER_HH__
#include <gecode/minimodel.hh>
#include <gecode/search.hh>
#ifdef GECODE_HAS_GIST
#include <gecode/gist.hh>
#endif
/*
* Configure linking
*
*/
#if !defined(GECODE_STATIC_LIBS) && \
(defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
#ifdef GECODE_BUILD_DRIVER
#define GECODE_DRIVER_EXPORT __declspec( dllexport )
#else
#define GECODE_DRIVER_EXPORT __declspec( dllimport )
#endif
#else
#ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
#define GECODE_DRIVER_EXPORT __attribute__ ((visibility("default")))
#else
#define GECODE_DRIVER_EXPORT
#endif
#endif
// Configure auto-linking
#ifndef GECODE_BUILD_DRIVER
#define GECODE_LIBRARY_NAME "Driver"
#include <gecode/support/auto-link.hpp>
#endif
namespace Gecode {
enum ScriptMode {
SM_SOLUTION,
SM_TIME,
SM_STAT,
SM_GIST,
SM_CPPROFILER
};
enum RestartMode {
RM_NONE,
RM_CONSTANT,
RM_LINEAR,
RM_LUBY,
RM_GEOMETRIC
};
class BaseOptions;
namespace Driver {
class GECODE_DRIVER_EXPORT BaseOption {
friend class Gecode::BaseOptions;
protected:
const char* eopt;
const char* iopt;
const char* exp;
BaseOption* next;
char* argument(int argc, char* argv[]) const;
public:
BaseOption(const char* o, const char* e);
virtual int parse(int argc, char* argv[]) = 0;
virtual void help(void) = 0;
virtual ~BaseOption(void);
static char* strdup(const char* s);
static char* stredup(const char* s);
static void strdel(const char* s);
};
class GECODE_DRIVER_EXPORT StringValueOption : public BaseOption {
protected:
const char* cur;
public:
StringValueOption(const char* o, const char* e, const char* v=NULL);
void value(const char* v);
const char* value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
virtual ~StringValueOption(void);
};
class GECODE_DRIVER_EXPORT StringOption : public BaseOption {
protected:
class Value {
public:
int val;
const char* opt;
const char* help;
Value* next;
};
int cur;
Value* fst;
Value* lst;
public:
StringOption(const char* o, const char* e, int v=0);
void value(int v);
int value(void) const;
void add(int v, const char* o, const char* h = NULL);
virtual int parse(int argc, char* argv[]);
virtual void help(void);
virtual ~StringOption(void);
};
class GECODE_DRIVER_EXPORT IntOption : public BaseOption {
protected:
int cur;
public:
IntOption(const char* o, const char* e, int v=0);
void value(int v);
int value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
class GECODE_DRIVER_EXPORT UnsignedIntOption : public BaseOption {
protected:
unsigned int cur;
public:
UnsignedIntOption(const char* o, const char* e, unsigned int v=0);
void value(unsigned int v);
unsigned int value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
class GECODE_DRIVER_EXPORT DoubleOption : public BaseOption {
protected:
double cur;
public:
DoubleOption(const char* o, const char* e, double v=0);
void value(double v);
double value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
class GECODE_DRIVER_EXPORT BoolOption : public BaseOption {
protected:
bool cur;
public:
BoolOption(const char* o, const char* e, bool v=false);
void value(bool v);
bool value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
class GECODE_DRIVER_EXPORT IplOption : public BaseOption {
protected:
IntPropLevel cur;
public:
IplOption(IntPropLevel ipl=IPL_DEF);
void value(IntPropLevel l);
IntPropLevel value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
class GECODE_DRIVER_EXPORT TraceOption : public BaseOption {
protected:
int cur;
public:
TraceOption(int f=0);
void value(int f);
int value(void) const;
virtual int parse(int argc, char* argv[]);
virtual void help(void);
};
}
class GECODE_DRIVER_EXPORT BaseOptions {
protected:
Driver::BaseOption* fst;
Driver::BaseOption* lst;
const char* _name;
public:
BaseOptions(const char* s);
virtual void help(void);
void add(Driver::BaseOption& o);
void parse(int& argc, char* argv[]);
const char* name(void) const;
void name(const char*);
virtual ~BaseOptions(void);
};
class GECODE_DRIVER_EXPORT Options : public BaseOptions {
protected:
Driver::StringOption _model;
Driver::StringOption _symmetry;
Driver::StringOption _propagation;
Driver::IplOption _ipl;
Driver::StringOption _branching;
Driver::DoubleOption _decay;
Driver::UnsignedIntOption _seed;
Driver::DoubleOption _step;
Driver::StringOption _search;
Driver::UnsignedIntOption _solutions;
Driver::DoubleOption _threads;
Driver::UnsignedIntOption _c_d;
Driver::UnsignedIntOption _a_d;
Driver::UnsignedIntOption _d_l;
Driver::UnsignedIntOption _node;
Driver::UnsignedIntOption _fail;
Driver::UnsignedIntOption _time;
Driver::UnsignedIntOption _assets;
Driver::UnsignedIntOption _slice;
Driver::StringOption _restart;
Driver::DoubleOption _r_base;
Driver::UnsignedIntOption _r_scale;
Driver::BoolOption _nogoods;
Driver::UnsignedIntOption _nogoods_limit;
Driver::DoubleOption _relax;
Driver::BoolOption _interrupt;
Driver::StringOption _mode;
Driver::UnsignedIntOption _samples;
Driver::UnsignedIntOption _iterations;
Driver::BoolOption _print_last;
Driver::StringValueOption _out_file;
Driver::StringValueOption _log_file;
Driver::TraceOption _trace;
#ifdef GECODE_HAS_CPPROFILER
Driver::IntOption _profiler_id;
Driver::UnsignedIntOption _profiler_port;
Driver::BoolOption _profiler_info;
#endif
public:
Options(const char* s);
void model(int v);
void model(int v, const char* o, const char* h = NULL);
int model(void) const;
void symmetry(int v);
void symmetry(int v, const char* o, const char* h = NULL);
int symmetry(void) const;
void propagation(int v);
void propagation(int v, const char* o, const char* h = NULL);
int propagation(void) const;
void ipl(IntPropLevel i);
IntPropLevel ipl(void) const;
void branching(int v);
void branching(int v, const char* o, const char* h = NULL);
int branching(void) const;
void decay(double d);
double decay(void) const;
void seed(unsigned int s);
unsigned int seed(void) const;
void step(double s);
double step(void) const;
void search(int v);
void search(int v, const char* o, const char* h = NULL);
int search(void) const;
void solutions(unsigned int n);
unsigned int solutions(void) const;
void threads(double n);
double threads(void) const;
void c_d(unsigned int d);
unsigned int c_d(void) const;
void a_d(unsigned int d);
unsigned int a_d(void) const;
void d_l(unsigned int d);
unsigned int d_l(void) const;
void node(unsigned int n);
unsigned int node(void) const;
void fail(unsigned int n);
unsigned int fail(void) const;
void time(unsigned int t);
unsigned int time(void) const;
void assets(unsigned int n);
unsigned int assets(void) const;
void slice(unsigned int n);
unsigned int slice(void) const;
void restart(RestartMode r);
RestartMode restart(void) const;
void restart_base(double base);
double restart_base(void) const;
void restart_scale(unsigned int scale);
unsigned int restart_scale(void) const;
void nogoods(bool b);
bool nogoods(void) const;
void nogoods_limit(unsigned int l);
unsigned int nogoods_limit(void) const;
void relax(double d);
double relax(void) const;
void interrupt(bool b);
bool interrupt(void) const;
void mode(ScriptMode em);
ScriptMode mode(void) const;
void samples(unsigned int s);
unsigned int samples(void) const;
void iterations(unsigned int i);
unsigned int iterations(void) const;
void print_last(bool p);
bool print_last(void) const;
void out_file(const char* f);
const char* out_file(void) const;
void log_file(const char* f);
const char* log_file(void) const;
void trace(int f);
int trace(void) const;
#ifdef GECODE_HAS_CPPROFILER
void profiler_id(int i);
int profiler_id(void) const;
void profiler_port(unsigned int p);
unsigned int profiler_port(void) const;
void profiler_info(bool b);
bool profiler_info(void) const;
#endif
#ifdef GECODE_HAS_GIST
class _I {
private:
Support::DynamicArray<Gist::Inspector*,Heap> _click;
unsigned int n_click;
Support::DynamicArray<Gist::Inspector*,Heap> _solution;
unsigned int n_solution;
Support::DynamicArray<Gist::Inspector*,Heap> _move;
unsigned int n_move;
Support::DynamicArray<Gist::Comparator*,Heap> _compare;
unsigned int n_compare;
public:
_I(void);
void click(Gist::Inspector* i);
void solution(Gist::Inspector* i);
void move(Gist::Inspector* i);
void compare(Gist::Comparator* i);
Gist::Inspector* click(unsigned int i) const;
Gist::Inspector* solution(unsigned int i) const;
Gist::Inspector* move(unsigned int i) const;
Gist::Comparator* compare(unsigned int i) const;
} inspect;
#endif
};
}
namespace Gecode {
class GECODE_DRIVER_EXPORT SizeOptions : public Options {
protected:
unsigned int _size;
public:
SizeOptions(const char* s);
virtual void help(void);
void parse(int& argc, char* argv[]);
void size(unsigned int s);
unsigned int size(void) const;
};
class GECODE_DRIVER_EXPORT InstanceOptions : public Options {
protected:
const char* _inst;
public:
InstanceOptions(const char* s);
virtual void help(void);
void parse(int& argc, char* argv[]);
void instance(const char* s);
const char* instance(void) const;
~InstanceOptions(void);
};
}
#include <gecode/driver/options.hpp>
namespace Gecode { namespace Driver {
template<class BaseSpace>
class ScriptBase : public BaseSpace {
public:
ScriptBase(const Options& opt);
ScriptBase(ScriptBase& e);
virtual void print(std::ostream& os) const;
virtual void compare(const Space& home, std::ostream& os) const;
static std::ostream& select_ostream(const char* sn, std::ofstream& ofs);
template<class Script, template<class> class Engine, class Options>
static void run(const Options& opt, Script* s=NULL);
private:
template<class Script, template<class> class Engine, class Options,
template<class, template<class> class> class Meta>
static void runMeta(const Options& opt, Script* s);
};
#ifdef GECODE_HAS_FLOAT_VARS
template<class BaseSpace>
class ExtractStepOption : public BaseSpace {
public:
ExtractStepOption(const Options& opt)
: BaseSpace(opt.step()) {}
ExtractStepOption(BaseSpace& e)
: BaseSpace(e) {}
};
#endif
template<class BaseSpace>
class IgnoreStepOption : public BaseSpace {
public:
IgnoreStepOption(const Options&) {}
IgnoreStepOption(BaseSpace& e)
: BaseSpace(e) {}
};
}}
#include <gecode/driver/script.hpp>
namespace Gecode {
typedef Driver::ScriptBase<Driver::IgnoreStepOption<Space> >
Script;
typedef Driver::ScriptBase<Driver::IgnoreStepOption<IntMinimizeSpace> >
IntMinimizeScript;
typedef Driver::ScriptBase<Driver::IgnoreStepOption<IntMaximizeSpace> >
IntMaximizeScript;
typedef Driver::ScriptBase<Driver::IgnoreStepOption<IntLexMinimizeSpace> >
IntLexMinimizeScript;
typedef Driver::ScriptBase<Driver::IgnoreStepOption<IntLexMaximizeSpace> >
IntLexMaximizeScript;
#ifdef GECODE_HAS_FLOAT_VARS
typedef Driver::ScriptBase<Driver::ExtractStepOption<FloatMinimizeSpace> >
FloatMinimizeScript;
typedef Driver::ScriptBase<Driver::ExtractStepOption<FloatMaximizeSpace> >
FloatMaximizeScript;
#endif
}
#endif
// STATISTICS: driver-any
auto-link.hpp
Gecode::BaseOptions
Base class for script options.
Definition driver.hh:331
Gecode::BaseOptions::BaseOptions
BaseOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:483
Gecode::BaseOptions::add
void add(Driver::BaseOption &o)
Add new option o.
Definition options.cpp:474
Gecode::BaseOptions::_name
const char * _name
Script name.
Definition driver.hh:335
Gecode::BaseOptions::fst
Driver::BaseOption * fst
First registered option.
Definition driver.hh:333
Gecode::BaseOptions::lst
Driver::BaseOption * lst
Last registered option.
Definition driver.hh:334
Gecode::BaseOptions::name
const char * name(void) const
Return name of script.
Definition options.hpp:166
Gecode::BaseOptions::help
virtual void help(void)
Print help text.
Definition options.cpp:494
Gecode::BaseOptions::parse
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:548
Gecode::Driver::BaseOption
Base class for options.
Definition driver.hh:121
Gecode::Driver::BaseOption::strdel
static void strdel(const char *s)
Delete heap-allocated copy of string s.
Definition options.cpp:71
Gecode::Driver::BaseOption::help
virtual void help(void)=0
Print help text.
Gecode::Driver::BaseOption::stredup
static char * stredup(const char *s)
Create heap-allocated copy of string s with hyphen added.
Definition options.cpp:61
Gecode::Driver::BaseOption::eopt
const char * eopt
String for option (excluding hyphen).
Definition driver.hh:124
Gecode::Driver::BaseOption::argument
char * argument(int argc, char *argv[]) const
Definition options.cpp:78
Gecode::Driver::BaseOption::strdup
static char * strdup(const char *s)
Create heap-allocated copy of string s.
Definition options.cpp:52
Gecode::Driver::BaseOption::exp
const char * exp
Short explanation.
Definition driver.hh:126
Gecode::Driver::BaseOption::iopt
const char * iopt
String for option (including hyphen).
Definition driver.hh:125
Gecode::Driver::BaseOption::BaseOption
BaseOption(const char *o, const char *e)
Initialize for option o and explanation e.
Definition options.cpp:99
Gecode::Driver::BaseOption::parse
virtual int parse(int argc, char *argv[])=0
Parse option at first position and return number of parsed arguments.
Gecode::Driver::BaseOption::next
BaseOption * next
Next option Check for option and return its argument.
Definition driver.hh:127
Gecode::Driver::BoolOption
Boolean option.
Definition driver.hh:269
Gecode::Driver::BoolOption::cur
bool cur
Current value.
Definition driver.hh:271
Gecode::Driver::BoolOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:249
Gecode::Driver::BoolOption::BoolOption
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
Gecode::Driver::BoolOption::value
void value(bool v)
Set default value to v.
Definition options.hpp:124
Gecode::Driver::BoolOption::help
virtual void help(void)
Print help text.
Definition options.cpp:281
Gecode::Driver::DoubleOption
Double option.
Definition driver.hh:249
Gecode::Driver::DoubleOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:232
Gecode::Driver::DoubleOption::cur
double cur
Current value.
Definition driver.hh:251
Gecode::Driver::DoubleOption::help
virtual void help(void)
Print help text.
Definition options.cpp:241
Gecode::Driver::DoubleOption::DoubleOption
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
Gecode::Driver::DoubleOption::value
void value(double v)
Set default value to v.
Definition options.hpp:108
Gecode::Driver::ExtractStepOption::ExtractStepOption
ExtractStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:768
Gecode::Driver::ExtractStepOption::ExtractStepOption
ExtractStepOption(const Options &opt)
Constructor that extracts the step value.
Definition driver.hh:765
Gecode::Driver::IgnoreStepOption::IgnoreStepOption
IgnoreStepOption(BaseSpace &e)
Constructor used for cloning.
Definition driver.hh:781
Gecode::Driver::IgnoreStepOption::IgnoreStepOption
IgnoreStepOption(const Options &)
Constructor.
Definition driver.hh:779
Gecode::Driver::IntOption
Integer option.
Definition driver.hh:209
Gecode::Driver::IntOption::help
virtual void help(void)
Print help text.
Definition options.cpp:208
Gecode::Driver::IntOption::value
void value(int v)
Set default value to v.
Definition options.hpp:74
Gecode::Driver::IntOption::cur
int cur
Current value.
Definition driver.hh:211
Gecode::Driver::IntOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:199
Gecode::Driver::IntOption::IntOption
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
Gecode::Driver::IplOption
Integer propagation level option.
Definition driver.hh:289
Gecode::Driver::IplOption::cur
IntPropLevel cur
Current value.
Definition driver.hh:291
Gecode::Driver::IplOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:297
Gecode::Driver::IplOption::IplOption
IplOption(IntPropLevel ipl=IPL_DEF)
Initialize with default value ipl.
Definition options.cpp:292
Gecode::Driver::IplOption::help
virtual void help(void)
Print help text.
Definition options.cpp:331
Gecode::Driver::IplOption::value
void value(IntPropLevel l)
Set default level to l.
Definition options.hpp:137
Gecode::Driver::ScriptBase
Parametric base-class for scripts.
Definition driver.hh:729
Gecode::Driver::ScriptBase::run
static void run(const Options &opt, Script *s=NULL)
Definition script.hpp:290
Gecode::Driver::ScriptBase::ScriptBase
ScriptBase(ScriptBase &e)
Constructor used for cloning.
Definition script.hpp:234
Gecode::Driver::ScriptBase::compare
virtual void compare(const Space &home, std::ostream &os) const
Compare with s.
Definition script.hpp:243
Gecode::Driver::ScriptBase::print
virtual void print(std::ostream &os) const
Print a solution to os.
Definition script.hpp:239
Gecode::Driver::ScriptBase::select_ostream
static std::ostream & select_ostream(const char *sn, std::ofstream &ofs)
Choose output stream according to sn.
Definition script.hpp:247
Gecode::Driver::ScriptBase::ScriptBase
ScriptBase(const Options &opt)
Constructor.
Definition script.hpp:229
Gecode::Driver::StringOption::Value
Option value.
Definition driver.hh:177
Gecode::Driver::StringOption::Value::help
const char * help
Optional help text.
Definition driver.hh:181
Gecode::Driver::StringOption::Value::next
Value * next
Next option value.
Definition driver.hh:182
Gecode::Driver::StringOption::Value::val
int val
Value for an option value.
Definition driver.hh:179
Gecode::Driver::StringOption::Value::opt
const char * opt
String for option value.
Definition driver.hh:180
Gecode::Driver::StringOption
String-valued option (integer value defined by strings).
Definition driver.hh:174
Gecode::Driver::StringOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:152
Gecode::Driver::StringOption::cur
int cur
Current value.
Definition driver.hh:184
Gecode::Driver::StringOption::StringOption
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
Gecode::Driver::StringOption::help
virtual void help(void)
Print help text.
Definition options.cpp:167
Gecode::Driver::StringOption::value
void value(int v)
Set default value to v.
Definition options.hpp:58
Gecode::Driver::StringOption::lst
Value * lst
Last option value.
Definition driver.hh:186
Gecode::Driver::StringOption::fst
Value * fst
First option value.
Definition driver.hh:185
Gecode::Driver::StringOption::add
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
Gecode::Driver::StringValueOption
String-valued option.
Definition driver.hh:151
Gecode::Driver::StringValueOption::help
virtual void help(void)
Print help text.
Definition options.cpp:126
Gecode::Driver::StringValueOption::value
void value(const char *v)
Set default value to v.
Definition options.cpp:113
Gecode::Driver::StringValueOption::StringValueOption
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
Gecode::Driver::StringValueOption::cur
const char * cur
Current value.
Definition driver.hh:153
Gecode::Driver::StringValueOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:118
Gecode::Driver::TraceOption
Trace flag option.
Definition driver.hh:309
Gecode::Driver::TraceOption::help
virtual void help(void)
Print help text.
Definition options.cpp:412
Gecode::Driver::TraceOption::cur
int cur
Current value.
Definition driver.hh:311
Gecode::Driver::TraceOption::TraceOption
TraceOption(int f=0)
Initialize with no tracing.
Definition options.cpp:353
Gecode::Driver::TraceOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:358
Gecode::Driver::TraceOption::value
void value(int f)
Set default trace flags to f.
Definition options.hpp:151
Gecode::Driver::UnsignedIntOption
Unsigned integer option.
Definition driver.hh:229
Gecode::Driver::UnsignedIntOption::value
void value(unsigned int v)
Set default value to v.
Definition options.hpp:91
Gecode::Driver::UnsignedIntOption::UnsignedIntOption
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
Gecode::Driver::UnsignedIntOption::parse
virtual int parse(int argc, char *argv[])
Parse option at first position and return number of parsed arguments.
Definition options.cpp:215
Gecode::Driver::UnsignedIntOption::cur
unsigned int cur
Current value.
Definition driver.hh:231
Gecode::Driver::UnsignedIntOption::help
virtual void help(void)
Print help text.
Definition options.cpp:224
Gecode::Gist::Comparator
Abstract base class for comparators.
Definition gist.hh:119
Gecode::Gist::Inspector
Abstract base class for inspectors.
Definition gist.hh:99
Gecode::InstanceOptions::_inst
const char * _inst
Instance string.
Definition driver.hh:698
Gecode::InstanceOptions::parse
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:700
Gecode::InstanceOptions::instance
void instance(const char *s)
Set default instance name.
Definition options.cpp:687
Gecode::InstanceOptions::help
virtual void help(void)
Print help text.
Definition options.cpp:693
Gecode::InstanceOptions::InstanceOptions
InstanceOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:683
Gecode::Options::_I::click
void click(Gist::Inspector *i)
Add inspector that reacts on node double clicks.
Definition options.hpp:548
Gecode::Options::_I::solution
void solution(Gist::Inspector *i)
Add inspector that reacts on each new solution that is found.
Definition options.hpp:552
Gecode::Options::_I::move
void move(Gist::Inspector *i)
Add inspector that reacts on each move of the cursor.
Definition options.hpp:556
Gecode::Options::_I::_I
_I(void)
Constructor.
Definition options.hpp:543
Gecode::Options::_I::compare
void compare(Gist::Comparator *i)
Add comparator.
Definition options.hpp:560
Gecode::Options
Options for scripts
Definition driver.hh:366
Gecode::Options::_relax
Driver::DoubleOption _relax
Probability to relax variable.
Definition driver.hh:398
Gecode::Options::trace
void trace(int f)
Set trace flags.
Definition options.hpp:499
Gecode::Options::_log_file
Driver::StringValueOption _log_file
Where to print statistics.
Definition driver.hh:409
Gecode::Options::c_d
void c_d(unsigned int d)
Set default copy recomputation distance.
Definition options.hpp:301
Gecode::Options::_model
Driver::StringOption _model
General model options.
Definition driver.hh:370
Gecode::Options::log_file
void log_file(const char *f)
Set default output file name for Gecode stats.
Definition options.hpp:489
Gecode::Options::print_last
void print_last(bool p)
Set whether to print only last solution found.
Definition options.hpp:470
Gecode::Options::_mode
Driver::StringOption _mode
Script mode to run.
Definition driver.hh:404
Gecode::Options::propagation
void propagation(int v)
Set default propagation value.
Definition options.hpp:203
Gecode::Options::iterations
void iterations(unsigned int i)
Set default number of iterations.
Definition options.hpp:461
Gecode::Options::_decay
Driver::DoubleOption _decay
Decay option.
Definition driver.hh:375
Gecode::Options::_nogoods_limit
Driver::UnsignedIntOption _nogoods_limit
Limit for no-good extraction.
Definition driver.hh:397
Gecode::Options::a_d
void a_d(unsigned int d)
Set default adaptive recomputation distance.
Definition options.hpp:310
Gecode::Options::profiler_id
void profiler_id(int i)
Set profiler execution identifier.
Definition options.hpp:515
Gecode::Options::seed
void seed(unsigned int s)
Set default seed value.
Definition options.hpp:247
Gecode::Options::_nogoods
Driver::BoolOption _nogoods
Whether to use no-goods.
Definition driver.hh:396
Gecode::Options::branching
void branching(int v)
Set default branching value.
Definition options.hpp:225
Gecode::Options::fail
void fail(unsigned int n)
Set default failure cutoff.
Definition options.hpp:337
Gecode::Options::solutions
void solutions(unsigned int n)
Set default number of solutions to search for.
Definition options.hpp:283
Gecode::Options::_slice
Driver::UnsignedIntOption _slice
Size of a portfolio slice.
Definition driver.hh:392
Gecode::Options::_trace
Driver::TraceOption _trace
Trace flags for tracing.
Definition driver.hh:410
Gecode::Options::_d_l
Driver::UnsignedIntOption _d_l
Discrepancy limit for LDS.
Definition driver.hh:387
Gecode::Options::slice
void slice(unsigned int n)
Set default slice size in a portfolio.
Definition options.hpp:364
Gecode::Options::_assets
Driver::UnsignedIntOption _assets
Number of assets in a portfolio.
Definition driver.hh:391
Gecode::Options::search
void search(int v)
Set default search value.
Definition options.hpp:270
Gecode::Options::_solutions
Driver::UnsignedIntOption _solutions
How many solutions.
Definition driver.hh:383
Gecode::Options::nogoods
void nogoods(bool b)
Set default nogoods posting behavior.
Definition options.hpp:400
Gecode::Options::symmetry
void symmetry(int v)
Set default symmetry value.
Definition options.hpp:190
Gecode::Options::profiler_port
void profiler_port(unsigned int p)
Set profiler port.
Definition options.hpp:523
Gecode::Options::_iterations
Driver::UnsignedIntOption _iterations
How many iterations per sample.
Definition driver.hh:406
Gecode::Options::_search
Driver::StringOption _search
Search options.
Definition driver.hh:382
Gecode::Options::_propagation
Driver::StringOption _propagation
Propagation options.
Definition driver.hh:372
Gecode::Options::_ipl
Driver::IplOption _ipl
Integer propagation level.
Definition driver.hh:373
Gecode::Options::restart
void restart(RestartMode r)
Set default restart mode.
Definition options.hpp:373
Gecode::Options::Options
Options(const char *s)
Initialize options for script with name s.
Definition options.cpp:576
Gecode::Options::_profiler_info
Driver::BoolOption _profiler_info
Whether solution information should be sent to the CPProfiler.
Definition driver.hh:415
Gecode::Options::_print_last
Driver::BoolOption _print_last
Print only last solution found.
Definition driver.hh:407
Gecode::Options::_c_d
Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition driver.hh:385
Gecode::Options::nogoods_limit
void nogoods_limit(unsigned int l)
Set default nogoods depth limit.
Definition options.hpp:409
Gecode::Options::step
void step(double s)
Set default step value.
Definition options.hpp:256
Gecode::Options::relax
void relax(double d)
Set default relax probability.
Definition options.hpp:418
Gecode::Options::ipl
void ipl(IntPropLevel i)
Set default integer propagation level.
Definition options.hpp:216
Gecode::Options::_threads
Driver::DoubleOption _threads
How many threads to use.
Definition driver.hh:384
Gecode::Options::_branching
Driver::StringOption _branching
Branching options.
Definition driver.hh:374
Gecode::Options::_restart
Driver::StringOption _restart
Restart method option.
Definition driver.hh:393
Gecode::Options::assets
void assets(unsigned int n)
Set default number of assets in a portfolio.
Definition options.hpp:355
Gecode::Options::_seed
Driver::UnsignedIntOption _seed
Seed option.
Definition driver.hh:376
Gecode::Options::_time
Driver::UnsignedIntOption _time
Cutoff for time.
Definition driver.hh:390
Gecode::Options::_step
Driver::DoubleOption _step
Step option.
Definition driver.hh:377
Gecode::Options::_profiler_port
Driver::UnsignedIntOption _profiler_port
Connect to this port.
Definition driver.hh:414
Gecode::Options::_r_scale
Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition driver.hh:395
Gecode::Options::_profiler_id
Driver::IntOption _profiler_id
Use this execution id for the CP-profiler.
Definition driver.hh:413
Gecode::Options::restart_scale
void restart_scale(unsigned int scale)
Set default restart scale factor.
Definition options.hpp:391
Gecode::Options::profiler_info
void profiler_info(bool b)
Whether solution info should be sent to profiler.
Definition options.hpp:531
Gecode::Options::interrupt
void interrupt(bool b)
Set default interrupt behavior.
Definition options.hpp:429
Gecode::Options::restart_base
void restart_base(double base)
Set default restart base.
Definition options.hpp:382
Gecode::Options::_interrupt
Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition driver.hh:399
Gecode::Options::d_l
void d_l(unsigned int d)
Set default discrepancy limit for LDS.
Definition options.hpp:319
Gecode::Options::model
void model(int v)
Set default model value.
Definition options.hpp:177
Gecode::Options::decay
void decay(double d)
Set default decay factor.
Definition options.hpp:238
Gecode::Options::_a_d
Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition driver.hh:386
Gecode::Options::node
void node(unsigned int n)
Set default node cutoff.
Definition options.hpp:328
Gecode::Options::samples
void samples(unsigned int s)
Set default number of samples.
Definition options.hpp:452
Gecode::Options::out_file
void out_file(const char *f)
Set default output file name for solutions.
Definition options.hpp:479
Gecode::Options::_r_base
Driver::DoubleOption _r_base
Restart base.
Definition driver.hh:394
Gecode::Options::_symmetry
Driver::StringOption _symmetry
General symmetry options.
Definition driver.hh:371
Gecode::Options::time
void time(unsigned int t)
Set default time cutoff.
Definition options.hpp:346
Gecode::Options::_out_file
Driver::StringValueOption _out_file
Where to print solutions.
Definition driver.hh:408
Gecode::Options::_node
Driver::UnsignedIntOption _node
Cutoff for number of nodes.
Definition driver.hh:388
Gecode::Options::_samples
Driver::UnsignedIntOption _samples
How many samples.
Definition driver.hh:405
Gecode::Options::mode
void mode(ScriptMode em)
Set default mode.
Definition options.hpp:443
Gecode::Options::_fail
Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Definition driver.hh:389
Gecode::Options::threads
void threads(double n)
Set number of parallel threads.
Definition options.hpp:292
Gecode::SizeOptions::help
virtual void help(void)
Print help text.
Definition options.cpp:667
Gecode::SizeOptions::SizeOptions
SizeOptions(const char *s)
Initialize options for script with name s.
Definition options.cpp:663
Gecode::SizeOptions::_size
unsigned int _size
Size value.
Definition driver.hh:677
Gecode::SizeOptions::size
void size(unsigned int s)
Set default size.
Definition options.hpp:586
Gecode::SizeOptions::parse
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc).
Definition options.cpp:674
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::Support::DynamicArray
Array with arbitrary number of elements.
Definition dynamic-array.hpp:44
options.hpp
GECODE_DRIVER_EXPORT
#define GECODE_DRIVER_EXPORT
Definition driver.hh:61
gist.hh
Gecode::ScriptMode
ScriptMode
Different modes for executing scripts.
Definition driver.hh:94
Gecode::RestartMode
RestartMode
Different modes for restart-based search.
Definition driver.hh:106
Gecode::SM_STAT
@ SM_STAT
Print statistics for script.
Definition driver.hh:97
Gecode::SM_SOLUTION
@ SM_SOLUTION
Print solution and some statistics.
Definition driver.hh:95
Gecode::SM_GIST
@ SM_GIST
Run script in Gist.
Definition driver.hh:98
Gecode::SM_CPPROFILER
@ SM_CPPROFILER
Run script with CP-profiler.
Definition driver.hh:99
Gecode::SM_TIME
@ SM_TIME
Measure average runtime.
Definition driver.hh:96
Gecode::RM_CONSTANT
@ RM_CONSTANT
Restart with constant sequence.
Definition driver.hh:108
Gecode::RM_LINEAR
@ RM_LINEAR
Restart with linear sequence.
Definition driver.hh:109
Gecode::RM_LUBY
@ RM_LUBY
Restart with Luby sequence.
Definition driver.hh:110
Gecode::RM_NONE
@ RM_NONE
No restarts.
Definition driver.hh:107
Gecode::RM_GEOMETRIC
@ RM_GEOMETRIC
Restart with geometric sequence.
Definition driver.hh:111
Gecode::IntMaximizeScript
Driver::ScriptBase< Driver::IgnoreStepOption< IntMaximizeSpace > > IntMaximizeScript
Base-class for scripts for finding solution of highest integer cost.
Definition driver.hh:814
Gecode::Script
Driver::ScriptBase< Driver::IgnoreStepOption< Space > > Script
Base-class for scripts.
Definition driver.hh:801
Gecode::FloatMinimizeScript
Driver::ScriptBase< Driver::ExtractStepOption< FloatMinimizeSpace > > FloatMinimizeScript
Base-class for scripts for finding solution of lowest float cost.
Definition driver.hh:836
Gecode::FloatMaximizeScript
Driver::ScriptBase< Driver::ExtractStepOption< FloatMaximizeSpace > > FloatMaximizeScript
Base-class for scripts for finding solution of highest float cost.
Definition driver.hh:842
Gecode::IntLexMaximizeScript
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMaximizeSpace > > IntLexMaximizeScript
Base-class for scripts for finding solution of lexically highest integer costs.
Definition driver.hh:827
Gecode::IntLexMinimizeScript
Driver::ScriptBase< Driver::IgnoreStepOption< IntLexMinimizeSpace > > IntLexMinimizeScript
Base-class for scripts for finding solution of lexically lowest integer costs.
Definition driver.hh:821
Gecode::IntMinimizeScript
Driver::ScriptBase< Driver::IgnoreStepOption< IntMinimizeSpace > > IntMinimizeScript
Base-class for scripts for finding solution of lowest integer cost.
Definition driver.hh:808
Gecode::IntPropLevel
IntPropLevel
Propagation levels for integer propagators.
Definition int.hh:974
Gecode::IPL_DEF
@ IPL_DEF
Simple propagation levels.
Definition int.hh:976
minimodel.hh
Gecode
Gecode toplevel namespace
script.hpp
search.hh