Generated on Tue May 31 2016 10:19:13 for Gecode by doxygen 1.8.11
flatzinc.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Guido Tack <tack@gecode.org>
5  *
6  * Contributing authors:
7  * Gabriel Hjort Blindell <gabriel.hjort.blindell@gmail.com>
8  *
9  * Copyright:
10  * Guido Tack, 2007-2012
11  * Gabriel Hjort Blindell, 2012
12  *
13  * Last modified:
14  * $Date: 2015-03-19 11:47:57 +0100 (Thu, 19 Mar 2015) $ by $Author: tack $
15  * $Revision: 14463 $
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_FLATZINC_HH__
43 #define __GECODE_FLATZINC_HH__
44 
45 #include <iostream>
46 
47 #include <gecode/kernel.hh>
48 #include <gecode/int.hh>
49 #ifdef GECODE_HAS_SET_VARS
50 #include <gecode/set.hh>
51 #endif
52 #ifdef GECODE_HAS_FLOAT_VARS
53 #include <gecode/float.hh>
54 #endif
55 #include <map>
56 
57 /*
58  * Support for DLLs under Windows
59  *
60  */
61 
62 #if !defined(GECODE_STATIC_LIBS) && \
63  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
64 
65 #ifdef GECODE_BUILD_FLATZINC
66 #define GECODE_FLATZINC_EXPORT __declspec( dllexport )
67 #else
68 #define GECODE_FLATZINC_EXPORT __declspec( dllimport )
69 #endif
70 
71 #else
72 
73 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
74 
75 #define GECODE_FLATZINC_EXPORT __attribute__ ((visibility("default")))
76 
77 #else
78 
79 #define GECODE_FLATZINC_EXPORT
80 
81 #endif
82 #endif
83 
84 // Configure auto-linking
85 #ifndef GECODE_BUILD_FLATZINC
86 #define GECODE_LIBRARY_NAME "FlatZinc"
88 #endif
89 
90 #include <gecode/driver.hh>
91 
93 #include <gecode/flatzinc/ast.hh>
95 
105 namespace Gecode { namespace FlatZinc {
106 
112  private:
113  AST::Array* _output;
114  void printElem(std::ostream& out,
115  AST::Node* ai,
116  const Gecode::IntVarArray& iv,
117  const Gecode::BoolVarArray& bv
118 #ifdef GECODE_HAS_SET_VARS
119  ,
120  const Gecode::SetVarArray& sv
121 #endif
123  ,
124  const Gecode::FloatVarArray& fv
125 #endif
126  ) const;
127  void printElemDiff(std::ostream& out,
128  AST::Node* ai,
129  const Gecode::IntVarArray& iv1,
130  const Gecode::IntVarArray& iv2,
131  const Gecode::BoolVarArray& bv1,
132  const Gecode::BoolVarArray& bv2
133 #ifdef GECODE_HAS_SET_VARS
134  ,
135  const Gecode::SetVarArray& sv1,
136  const Gecode::SetVarArray& sv2
137 #endif
138 #ifdef GECODE_HAS_FLOAT_VARS
139  ,
140  const Gecode::FloatVarArray& fv1,
141  const Gecode::FloatVarArray& fv2
142 #endif
143  ) const;
144  public:
145  Printer(void) : _output(NULL) {}
146  void init(AST::Array* output);
147 
148  void print(std::ostream& out,
149  const Gecode::IntVarArray& iv,
150  const Gecode::BoolVarArray& bv
151 #ifdef GECODE_HAS_SET_VARS
152  ,
153  const Gecode::SetVarArray& sv
154 #endif
155 #ifdef GECODE_HAS_FLOAT_VARS
156  ,
157  const Gecode::FloatVarArray& fv
158 #endif
159  ) const;
160 
161  void printDiff(std::ostream& out,
162  const Gecode::IntVarArray& iv1, const Gecode::IntVarArray& iv2,
163  const Gecode::BoolVarArray& bv1, const Gecode::BoolVarArray& bv2
164 #ifdef GECODE_HAS_SET_VARS
165  ,
166  const Gecode::SetVarArray& sv1, const Gecode::SetVarArray& sv2
167 #endif
168 #ifdef GECODE_HAS_FLOAT_VARS
169  ,
170  const Gecode::FloatVarArray& fv1,
171  const Gecode::FloatVarArray& fv2
172 #endif
173  ) const;
174 
175 
176  ~Printer(void);
177 
178  void shrinkElement(AST::Node* node,
179  std::map<int,int>& iv, std::map<int,int>& bv,
180  std::map<int,int>& sv, std::map<int,int>& fv);
181 
182  void shrinkArrays(Space& home,
183  int& optVar, bool optVarIsInt,
186 #ifdef GECODE_HAS_SET_VARS
187  ,
189 #endif
190 #ifdef GECODE_HAS_FLOAT_VARS
191  ,
193 #endif
194  );
195 
196  private:
197  Printer(const Printer&);
198  Printer& operator=(const Printer&);
199  };
200 
206  protected:
208 
227 
228 
230 
234 
235  public:
237  FlatZincOptions(const char* s)
238  : Gecode::BaseOptions(s),
239  _solutions("-n","number of solutions (0 = all, -1 = one/best)",-1),
240  _allSolutions("-a", "return all solutions (equal to -n 0)"),
241  _threads("-p","number of threads (0 = #processing units)",
242  Gecode::Search::Config::threads),
243  _free("-f", "free search, no need to follow search-specification"),
244  _decay("-decay","decay factor",0.99),
245  _c_d("-c-d","recomputation commit distance",Gecode::Search::Config::c_d),
246  _a_d("-a-d","recomputation adaption distance",Gecode::Search::Config::a_d),
247  _node("-node","node cutoff (0 = none, solution mode)"),
248  _fail("-fail","failure cutoff (0 = none, solution mode)"),
249  _time("-time","time (in ms) cutoff (0 = none, solution mode)"),
250  _seed("-r","random seed",0),
251  _restart("-restart","restart sequence type",RM_NONE),
252  _r_base("-restart-base","base for geometric restart sequence",1.5),
253  _r_scale("-restart-scale","scale factor for restart sequence",250),
254  _nogoods("-nogoods","whether to use no-goods from restarts",false),
255  _nogoods_limit("-nogoods-limit","depth limit for no-good extraction",
256  Search::Config::nogoods_limit),
257  _interrupt("-interrupt","whether to catch Ctrl-C (true) or not (false)",
258  true),
259  _step("-step","step distance for float optimization",0.0),
260  _mode("-mode","how to execute script",Gecode::SM_SOLUTION),
261  _stat("-s","emit statistics"),
262  _output("-o","file to send output to") {
263 
264  _mode.add(Gecode::SM_SOLUTION, "solution");
265  _mode.add(Gecode::SM_STAT, "stat");
266  _mode.add(Gecode::SM_GIST, "gist");
267  _restart.add(RM_NONE,"none");
268  _restart.add(RM_CONSTANT,"constant");
269  _restart.add(RM_LINEAR,"linear");
270  _restart.add(RM_LUBY,"luby");
271  _restart.add(RM_GEOMETRIC,"geometric");
272 
273  add(_solutions); add(_threads); add(_c_d); add(_a_d);
274  add(_allSolutions);
275  add(_free);
276  add(_decay);
277  add(_node); add(_fail); add(_time); add(_interrupt);
278  add(_seed);
279  add(_step);
280  add(_restart); add(_r_base); add(_r_scale);
281  add(_nogoods); add(_nogoods_limit);
282  add(_mode); add(_stat);
283  add(_output);
284  }
285 
286  void parse(int& argc, char* argv[]) {
287  Gecode::BaseOptions::parse(argc,argv);
288  if (_allSolutions.value() && _solutions.value()==-1) {
289  _solutions.value(0);
290  }
291  if (_stat.value())
292  _mode.value(Gecode::SM_STAT);
293  }
294 
295  virtual void help(void) {
296  std::cerr << "Gecode FlatZinc interpreter" << std::endl
297  << " - Supported FlatZinc version: " << GECODE_FLATZINC_VERSION
298  << std::endl << std::endl;
300  }
301 
302  int solutions(void) const { return _solutions.value(); }
303  bool allSolutions(void) const { return _allSolutions.value(); }
304  double threads(void) const { return _threads.value(); }
305  bool free(void) const { return _free.value(); }
306  unsigned int c_d(void) const { return _c_d.value(); }
307  unsigned int a_d(void) const { return _a_d.value(); }
308  unsigned int node(void) const { return _node.value(); }
309  unsigned int fail(void) const { return _fail.value(); }
310  unsigned int time(void) const { return _time.value(); }
311  int seed(void) const { return _seed.value(); }
312  double step(void) const { return _step.value(); }
313  const char* output(void) const { return _output.value(); }
314  Gecode::ScriptMode mode(void) const {
315  return static_cast<Gecode::ScriptMode>(_mode.value());
316  }
317 
318  double decay(void) const { return _decay.value(); }
319  RestartMode restart(void) const {
320  return static_cast<RestartMode>(_restart.value());
321  }
322  double restart_base(void) const { return _r_base.value(); }
323  unsigned int restart_scale(void) const { return _r_scale.value(); }
324  bool nogoods(void) const { return _nogoods.value(); }
325  unsigned int nogoods_limit(void) const { return _nogoods_limit.value(); }
326  bool interrupt(void) const { return _interrupt.value(); }
327 
328  void allSolutions(bool b) { _allSolutions.value(b); }
329  };
330 
332  public:
334  BranchInformation(void);
338  void init(void);
340  void add(const BrancherHandle& bh,
341  const std::string& rel0,
342  const std::string& rel1,
343  const std::vector<std::string>& n);
345  void print(const BrancherHandle& bh,
346  int a, int i, int n, std::ostream& o) const;
347 #ifdef GECODE_HAS_FLOAT_VARS
348  void print(const BrancherHandle& bh,
350  int a, int i, const FloatNumBranch& nl, std::ostream& o) const;
351 #endif
352  };
353 
359  protected:
364  public:
366  FznRnd(unsigned int s=1);
368  unsigned int operator ()(unsigned int n);
369  };
370 
376  public:
377  enum Meth {
378  SAT, //< Solve as satisfaction problem
379  MIN, //< Solve as minimization problem
380  MAX //< Solve as maximization problem
381  };
382  protected:
391 
393  int _optVar;
396 
399 
401  unsigned int _lns;
402 
405 
408 
410  FlatZincSpace(bool share, FlatZincSpace&);
411  private:
413  template<template<class> class Engine>
414  void
415  runEngine(std::ostream& out, const Printer& p,
416  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
418  template<template<class> class Engine,
419  template<template<class> class,class> class Meta>
420  void
421  runMeta(std::ostream& out, const Printer& p,
422  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
423  void
424  branchWithPlugin(AST::Node* ann);
425  public:
430 
433 
435  std::vector<bool> iv_introduced;
437  int* iv_boolalias;
443  std::vector<bool> bv_introduced;
444 #ifdef GECODE_HAS_SET_VARS
450  std::vector<bool> sv_introduced;
451 #endif
452 #ifdef GECODE_HAS_FLOAT_VARS
458  std::vector<bool> fv_introduced;
461 #endif
462  bool needAuxVars;
465  FlatZincSpace(FznRnd* random = NULL);
466 
468  ~FlatZincSpace(void);
469 
471  void init(int intVars, int boolVars, int setVars, int floatVars);
472 
474  void newIntVar(IntVarSpec* vs);
476  void aliasBool2Int(int iv, int bv);
478  int aliasBool2Int(int iv);
480  void newBoolVar(BoolVarSpec* vs);
482  void newSetVar(SetVarSpec* vs);
484  void newFloatVar(FloatVarSpec* vs);
485 
487  void postConstraints(std::vector<ConExpr*>& ces);
488 
490  void solve(AST::Array* annotation);
492  void minimize(int var, bool isInt, AST::Array* annotation);
494  void maximize(int var, bool isInt, AST::Array* annotation);
495 
497  void run(std::ostream& out, const Printer& p,
498  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
499 
501  void print(std::ostream& out, const Printer& p) const;
502 
505  void compare(const Space& s, std::ostream& out) const;
508  void compare(const FlatZincSpace& s, std::ostream& out,
509  const Printer& p) const;
510 
519  void shrinkArrays(Printer& p);
520 
522  Meth method(void) const;
523 
525  int optVar(void) const;
527  bool optVarIsInt(void) const;
528 
538  void createBranchers(AST::Node* ann,
539  int seed, double decay,
540  bool ignoreUnknown,
541  std::ostream& err = std::cerr);
542 
544  AST::Array* solveAnnotations(void) const;
545 
547  BranchInformation branchInfo;
548 
550  virtual void constrain(const Space& s);
552  virtual Gecode::Space* copy(bool share);
553 
554  virtual bool slave(const CRI& cri);
555 
557 
558  IntArgs arg2intargs(AST::Node* arg, int offset = 0);
561  IntArgs arg2boolargs(AST::Node* arg, int offset = 0);
563  IntSet arg2intset(AST::Node* n);
565  IntSetArgs arg2intsetargs(AST::Node* arg, int offset = 0);
567  IntVarArgs arg2intvarargs(AST::Node* arg, int offset = 0);
569  BoolVarArgs arg2boolvarargs(AST::Node* arg, int offset = 0, int siv=-1);
571  BoolVar arg2BoolVar(AST::Node* n);
573  IntVar arg2IntVar(AST::Node* n);
575  bool isBoolArray(AST::Node* b, int& singleInt);
576 #ifdef GECODE_HAS_SET_VARS
577  SetVar arg2SetVar(AST::Node* n);
580  SetVarArgs arg2setvarargs(AST::Node* arg, int offset = 0, int doffset = 0,
581  const IntSet& od=IntSet::empty);
582 #endif
583 #ifdef GECODE_HAS_FLOAT_VARS
584  FloatValArgs arg2floatargs(AST::Node* arg, int offset = 0);
587  FloatVar arg2FloatVar(AST::Node* n);
589  FloatVarArgs arg2floatvarargs(AST::Node* arg, int offset = 0);
590 #endif
591  IntConLevel ann2icl(AST::Node* ann);
594  };
595 
598  private:
599  const std::string msg;
600  public:
601  Error(const std::string& where, const std::string& what)
602  : msg(where+": "+what) {}
603  const std::string& toString(void) const { return msg; }
604  };
605 
612  FlatZincSpace* parse(const std::string& fileName,
613  Printer& p, std::ostream& err = std::cerr,
614  FlatZincSpace* fzs=NULL, FznRnd* rnd=NULL);
615 
622  FlatZincSpace* parse(std::istream& is,
623  Printer& p, std::ostream& err = std::cerr,
624  FlatZincSpace* fzs=NULL, FznRnd* rnd=NULL);
625 
626 }}
627 
628 #endif
629 
630 // STATISTICS: flatzinc-any
Restart with linear sequence.
Definition: driver.hh:112
Gecode::Driver::IntOption _solutions
How many solutions.
Definition: flatzinc.hh:209
int floatVarCount
Number of float variables.
Definition: flatzinc.hh:388
void value(int v)
Set default value to v.
Definition: options.hpp:62
const Gecode::FloatNum step
Definition: arithmetic.cpp:789
Passing float arguments.
Definition: float.hh:937
Options for running FlatZinc models
Definition: flatzinc.hh:205
Gecode::ScriptMode mode(void) const
Definition: flatzinc.hh:314
Gecode::Support::RandomGenerator random
The actual random number generator.
Definition: flatzinc.hh:361
IntConLevel
Consistency levels for integer propagators.
Definition: int.hh:937
The shared handle.
Definition: core.hpp:79
#define GECODE_FLATZINC_VERSION
Definition: config.hpp:14
unsigned int restart_scale(void) const
Definition: flatzinc.hh:323
Gecode::Driver::UnsignedIntOption _time
Cutoff for time.
Definition: flatzinc.hh:218
Gecode::Driver::BoolOption _allSolutions
Return all solutions.
Definition: flatzinc.hh:210
#define GECODE_HAS_SET_VARS
Definition: config.hpp:44
void value(double v)
Set default value to v.
Definition: options.hpp:112
ScriptMode
Different modes for executing scripts.
Definition: driver.hh:98
Gecode::Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition: flatzinc.hh:222
Meth _method
Whether to solve as satisfaction or optimization problem.
Definition: flatzinc.hh:398
Boolean option.
Definition: driver.hh:269
#define GECODE_FLATZINC_EXPORT
Definition: flatzinc.hh:79
Handle for brancher.
Definition: core.hpp:1157
Passing float variables.
Definition: float.hh:966
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:121
unsigned int nogoods_limit(void) const
Definition: flatzinc.hh:325
int boolVarCount
Number of Boolean variables.
Definition: flatzinc.hh:386
Gecode::Driver::StringOption _restart
Restart method option.
Definition: flatzinc.hh:220
const char * output(void) const
Definition: flatzinc.hh:313
Gecode::Driver::BoolOption _free
Use free search.
Definition: flatzinc.hh:212
Integer variable array.
Definition: int.hh:741
Restart with Luby sequence.
Definition: driver.hh:113
Gecode::Driver::UnsignedIntOption _nogoods_limit
Depth limit for extracting no-goods.
Definition: flatzinc.hh:224
No restarts.
Definition: driver.hh:110
Gecode::Driver::BoolOption _stat
Emit statistics.
Definition: flatzinc.hh:232
unsigned int time(void) const
Definition: flatzinc.hh:310
A thread-safe random number generator.
Definition: flatzinc.hh:358
RestartMode
Different modes for restart-based search.
Definition: driver.hh:109
Gecode::Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition: flatzinc.hh:215
Float variable array.
Definition: float.hh:1016
Computation spaces.
Definition: core.hpp:1362
String-valued option.
Definition: driver.hh:151
Gecode::Driver::DoubleOption _decay
Decay option.
Definition: flatzinc.hh:213
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.
void value(unsigned int v)
Set default value to v.
Definition: options.hpp:95
double threads(void) const
Definition: flatzinc.hh:304
double decay(void) const
Definition: flatzinc.hh:318
A mutex for mutual exclausion among several threads.
Definition: thread.hpp:99
unsigned int node(void) const
Definition: flatzinc.hh:308
Gecode::Support::Mutex mutex
A mutex for the random number generator.
Definition: flatzinc.hh:363
const BoolInstr * bi[]
Definition: mm-bool.cpp:4169
void value(int v)
Set default value to v.
Definition: options.hpp:78
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Gecode::Driver::StringOption _mode
Script mode to run.
Definition: flatzinc.hh:231
Options opt
The options.
Definition: test.cpp:101
unsigned int c_d(void) const
Definition: flatzinc.hh:306
Print solution and some statistics.
Definition: driver.hh:99
Value description class for branching.
Definition: float.hh:1372
Gecode::Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Definition: flatzinc.hh:217
int _optVar
Index of the variable to optimize.
Definition: flatzinc.hh:393
Output support class for FlatZinc interpreter.
Definition: flatzinc.hh:111
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Definition: search.hh:99
Base class for script options.
Definition: driver.hh:291
FznRnd * _random
Random number generator.
Definition: flatzinc.hh:404
Gecode::Driver::DoubleOption _step
Step option.
Definition: flatzinc.hh:226
const std::string & toString(void) const
Definition: flatzinc.hh:603
Error(const std::string &where, const std::string &what)
Definition: flatzinc.hh:601
Unsigned integer option.
Definition: driver.hh:229
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
Template for linear congruential generators.
Definition: random.hpp:50
Integer sets.
Definition: int.hh:171
Passing integer variables.
Definition: int.hh:636
const double threads
Number of threads to use.
Definition: search.hh:95
Passing integer arguments.
Definition: int.hh:607
Passing Boolean variables.
Definition: int.hh:690
Gecode::Driver::IntOption _seed
Random seed.
Definition: flatzinc.hh:219
virtual void help(void)
Print help text.
Definition: flatzinc.hh:295
bool _optVarIsInt
Whether variable to optimize is integer (or float)
Definition: flatzinc.hh:395
RestartMode restart(void) const
Definition: flatzinc.hh:319
Boolean variable array.
Definition: int.hh:786
Boolean integer variables.
Definition: int.hh:491
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition: options.cpp:331
BrancherHandle bh
String-valued option (integer value defined by strings)
Definition: driver.hh:174
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
Definition: print.hpp:67
Gecode::Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition: flatzinc.hh:225
Passing set variables.
Definition: set.hh:490
struct Gecode::@519::NNF::@60::@61 b
For binary nodes (and, or, eqv)
double restart_base(void) const
Definition: flatzinc.hh:322
Print statistics for script.
Definition: driver.hh:101
Gecode::Driver::DoubleOption _r_base
Restart base.
Definition: flatzinc.hh:221
Set variables
Definition: set.hh:129
void value(const char *v)
Set default value to v.
Definition: options.cpp:96
Restart with geometric sequence.
Definition: driver.hh:114
Gecode::Driver::BoolOption _nogoods
Whether to use no-goods.
Definition: flatzinc.hh:223
Integer variables.
Definition: int.hh:350
Gecode::Driver::DoubleOption _threads
How many threads to use.
Definition: flatzinc.hh:211
Exception class for FlatZinc errors
Definition: flatzinc.hh:597
AST::Array * _solveAnnotations
Annotations on the solve item.
Definition: flatzinc.hh:407
bool allSolutions(void) const
Definition: flatzinc.hh:303
Gecode::Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition: flatzinc.hh:214
Run script in Gist.
Definition: driver.hh:102
void value(bool v)
Set default value to v.
Definition: options.hpp:128
double step(void) const
Definition: flatzinc.hh:312
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
Definition: search.hh:97
#define GECODE_HAS_FLOAT_VARS
Definition: config.hpp:23
Float variables.
Definition: float.hh:857
A space that can be initialized with a FlatZinc model.
Definition: flatzinc.hh:375
Set variable array
Definition: set.hh:571
CompareStatus compare(I &i, J &j)
Check whether range iterator i is a subset of j, or whether they are disjoint.
Gecode::Driver::StringValueOption _output
Output file.
Definition: flatzinc.hh:233
Gecode toplevel namespace
int setVarCount
Number of set variables.
Definition: flatzinc.hh:390
int intVarCount
Number of integer variables.
Definition: flatzinc.hh:384
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76
A node in a FlatZinc abstract syntax tree.
Definition: ast.hh:71
unsigned int fail(void) const
Definition: flatzinc.hh:309
const unsigned int nogoods_limit
Depth limit for no-good generation during search.
Definition: search.hh:107
Gecode::Driver::UnsignedIntOption _node
Cutoff for number of nodes.
Definition: flatzinc.hh:216
unsigned int _lns
Percentage of variables to keep in LNS (or 0 for no LNS)
Definition: flatzinc.hh:401
double FloatNum
Floating point number base type.
Definition: float.hh:108
FlatZincOptions(const char *s)
Constructor.
Definition: flatzinc.hh:237
Restart with constant sequence.
Definition: driver.hh:111
Integer option.
Definition: driver.hh:209
void parse(int &argc, char *argv[])
Definition: flatzinc.hh:286
unsigned int a_d(void) const
Definition: flatzinc.hh:307
virtual void help(void)
Print help text.
Definition: options.cpp:284