Generated on Fri Jul 13 2018 06:08:22 for Gecode by doxygen 1.8.14
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: 2016-08-26 02:45:29 +0200 (Fri, 26 Aug 2016) $ by $Author: tack $
15  * $Revision: 15155 $
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:
114  std::vector<std::string> iv_names;
116  std::vector<std::string> bv_names;
117 #ifdef GECODE_HAS_FLOAT_VARS
118  std::vector<std::string> fv_names;
120 #endif
121 #ifdef GECODE_HAS_SET_VARS
122  std::vector<std::string> sv_names;
124 #endif
125  AST::Array* _output;
126  void printElem(std::ostream& out,
127  AST::Node* ai,
128  const Gecode::IntVarArray& iv,
129  const Gecode::BoolVarArray& bv
130 #ifdef GECODE_HAS_SET_VARS
131  ,
132  const Gecode::SetVarArray& sv
133 #endif
135  ,
136  const Gecode::FloatVarArray& fv
137 #endif
138  ) const;
139  void printElemDiff(std::ostream& out,
140  AST::Node* ai,
141  const Gecode::IntVarArray& iv1,
142  const Gecode::IntVarArray& iv2,
143  const Gecode::BoolVarArray& bv1,
144  const Gecode::BoolVarArray& bv2
145 #ifdef GECODE_HAS_SET_VARS
146  ,
147  const Gecode::SetVarArray& sv1,
148  const Gecode::SetVarArray& sv2
149 #endif
151  ,
152  const Gecode::FloatVarArray& fv1,
153  const Gecode::FloatVarArray& fv2
154 #endif
155  ) const;
156  public:
157  Printer(void) : _output(NULL) {}
158  void init(AST::Array* output);
159 
160  void print(std::ostream& out,
161  const Gecode::IntVarArray& iv,
162  const Gecode::BoolVarArray& bv
163 #ifdef GECODE_HAS_SET_VARS
164  ,
165  const Gecode::SetVarArray& sv
166 #endif
168  ,
169  const Gecode::FloatVarArray& fv
170 #endif
171  ) const;
172 
173  void printDiff(std::ostream& out,
174  const Gecode::IntVarArray& iv1, const Gecode::IntVarArray& iv2,
175  const Gecode::BoolVarArray& bv1, const Gecode::BoolVarArray& bv2
176 #ifdef GECODE_HAS_SET_VARS
177  ,
178  const Gecode::SetVarArray& sv1, const Gecode::SetVarArray& sv2
179 #endif
181  ,
182  const Gecode::FloatVarArray& fv1,
183  const Gecode::FloatVarArray& fv2
184 #endif
185  ) const;
186 
187 
188  ~Printer(void);
189 
190  void addIntVarName(const std::string& n);
191  const std::string& intVarName(int i) const { return iv_names[i]; }
192  void addBoolVarName(const std::string& n);
193  const std::string& boolVarName(int i) const { return bv_names[i]; }
194 #ifdef GECODE_HAS_FLOAT_VARS
195  void addFloatVarName(const std::string& n);
196  const std::string& floatVarName(int i) const { return fv_names[i]; }
197 #endif
198 #ifdef GECODE_HAS_SET_VARS
199  void addSetVarName(const std::string& n);
200  const std::string& setVarName(int i) const { return sv_names[i]; }
201 #endif
202 
203  void shrinkElement(AST::Node* node,
204  std::map<int,int>& iv, std::map<int,int>& bv,
205  std::map<int,int>& sv, std::map<int,int>& fv);
206 
207  void shrinkArrays(Space& home,
208  int& optVar, bool optVarIsInt,
211 #ifdef GECODE_HAS_SET_VARS
212  ,
214 #endif
216  ,
218 #endif
219  );
220 
221  private:
222  Printer(const Printer&);
223  Printer& operator=(const Printer&);
224  };
225 
231  protected:
233 
252 
253 
255 
259 
260  public:
262  FlatZincOptions(const char* s)
263  : Gecode::BaseOptions(s),
264  _solutions("-n","number of solutions (0 = all, -1 = one/best)",-1),
265  _allSolutions("-a", "return all solutions (equal to -n 0)"),
266  _threads("-p","number of threads (0 = #processing units)",
267  Gecode::Search::Config::threads),
268  _free("-f", "free search, no need to follow search-specification"),
269  _decay("-decay","decay factor",0.99),
270  _c_d("-c-d","recomputation commit distance",Gecode::Search::Config::c_d),
271  _a_d("-a-d","recomputation adaption distance",Gecode::Search::Config::a_d),
272  _node("-node","node cutoff (0 = none, solution mode)"),
273  _fail("-fail","failure cutoff (0 = none, solution mode)"),
274  _time("-time","time (in ms) cutoff (0 = none, solution mode)"),
275  _seed("-r","random seed",0),
276  _restart("-restart","restart sequence type",RM_NONE),
277  _r_base("-restart-base","base for geometric restart sequence",1.5),
278  _r_scale("-restart-scale","scale factor for restart sequence",250),
279  _nogoods("-nogoods","whether to use no-goods from restarts",false),
280  _nogoods_limit("-nogoods-limit","depth limit for no-good extraction",
281  Search::Config::nogoods_limit),
282  _interrupt("-interrupt","whether to catch Ctrl-C (true) or not (false)",
283  true),
284  _step("-step","step distance for float optimization",0.0),
285  _mode("-mode","how to execute script",Gecode::SM_SOLUTION),
286  _stat("-s","emit statistics"),
287  _output("-o","file to send output to") {
288 
289  _mode.add(Gecode::SM_SOLUTION, "solution");
290  _mode.add(Gecode::SM_STAT, "stat");
291  _mode.add(Gecode::SM_GIST, "gist");
292  _restart.add(RM_NONE,"none");
293  _restart.add(RM_CONSTANT,"constant");
294  _restart.add(RM_LINEAR,"linear");
295  _restart.add(RM_LUBY,"luby");
296  _restart.add(RM_GEOMETRIC,"geometric");
297 
300  add(_free);
301  add(_decay);
303  add(_seed);
304  add(_step);
307  add(_mode); add(_stat);
308  add(_output);
309  }
310 
311  void parse(int& argc, char* argv[]) {
312  Gecode::BaseOptions::parse(argc,argv);
313  if (_allSolutions.value() && _solutions.value()==-1) {
314  _solutions.value(0);
315  }
316  if (_stat.value())
318  }
319 
320  virtual void help(void) {
321  std::cerr << "Gecode FlatZinc interpreter" << std::endl
322  << " - Supported FlatZinc version: " << GECODE_FLATZINC_VERSION
323  << std::endl << std::endl;
325  }
326 
327  int solutions(void) const { return _solutions.value(); }
328  bool allSolutions(void) const { return _allSolutions.value(); }
329  double threads(void) const { return _threads.value(); }
330  bool free(void) const { return _free.value(); }
331  unsigned int c_d(void) const { return _c_d.value(); }
332  unsigned int a_d(void) const { return _a_d.value(); }
333  unsigned int node(void) const { return _node.value(); }
334  unsigned int fail(void) const { return _fail.value(); }
335  unsigned int time(void) const { return _time.value(); }
336  int seed(void) const { return _seed.value(); }
337  double step(void) const { return _step.value(); }
338  const char* output(void) const { return _output.value(); }
339  Gecode::ScriptMode mode(void) const {
340  return static_cast<Gecode::ScriptMode>(_mode.value());
341  }
342 
343  double decay(void) const { return _decay.value(); }
344  RestartMode restart(void) const {
345  return static_cast<RestartMode>(_restart.value());
346  }
347  double restart_base(void) const { return _r_base.value(); }
348  unsigned int restart_scale(void) const { return _r_scale.value(); }
349  bool nogoods(void) const { return _nogoods.value(); }
350  unsigned int nogoods_limit(void) const { return _nogoods_limit.value(); }
351  bool interrupt(void) const { return _interrupt.value(); }
352 
353  void allSolutions(bool b) { _allSolutions.value(b); }
354  };
355 
357  public:
359  BranchInformation(void);
363  void init(void);
365  void add(BrancherGroup bg,
366  const std::string& rel0,
367  const std::string& rel1,
368  const std::vector<std::string>& n);
370  void print(const Brancher& b,
371  unsigned int a, int i, int n, std::ostream& o) const;
372 #ifdef GECODE_HAS_FLOAT_VARS
373  void print(const Brancher& b,
375  unsigned int a, int i, const FloatNumBranch& nl,
376  std::ostream& o) const;
377 #endif
378  };
379 
385  protected:
390  public:
392  FznRnd(unsigned int s=1);
394  unsigned int operator ()(unsigned int n);
395  };
396 
402  public:
403  enum Meth {
404  SAT, //< Solve as satisfaction problem
405  MIN, //< Solve as minimization problem
406  MAX //< Solve as maximization problem
407  };
408  protected:
417 
419  int _optVar;
422 
425 
427  unsigned int _lns;
428 
431 
434 
437 
439  FlatZincSpace(bool share, FlatZincSpace&);
440  private:
442  template<template<class> class Engine>
443  void
444  runEngine(std::ostream& out, const Printer& p,
445  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
447  template<template<class> class Engine,
448  template<class, template<class> class> class Meta>
449  void
450  runMeta(std::ostream& out, const Printer& p,
451  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
452  void
453  branchWithPlugin(AST::Node* ann);
454  public:
459 
462 
464  std::vector<bool> iv_introduced;
466  int* iv_boolalias;
472  std::vector<bool> bv_introduced;
473 #ifdef GECODE_HAS_SET_VARS
479  std::vector<bool> sv_introduced;
480 #endif
481 #ifdef GECODE_HAS_FLOAT_VARS
487  std::vector<bool> fv_introduced;
490 #endif
491  bool needAuxVars;
494  FlatZincSpace(FznRnd* random = NULL);
495 
497  ~FlatZincSpace(void);
498 
500  void init(int intVars, int boolVars, int setVars, int floatVars);
501 
503  void newIntVar(IntVarSpec* vs);
505  void aliasBool2Int(int iv, int bv);
507  int aliasBool2Int(int iv);
509  void newBoolVar(BoolVarSpec* vs);
511  void newSetVar(SetVarSpec* vs);
513  void newFloatVar(FloatVarSpec* vs);
514 
516  void postConstraints(std::vector<ConExpr*>& ces);
517 
519  void solve(AST::Array* annotation);
521  void minimize(int var, bool isInt, AST::Array* annotation);
523  void maximize(int var, bool isInt, AST::Array* annotation);
524 
526  void run(std::ostream& out, const Printer& p,
527  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
528 
530  void print(std::ostream& out, const Printer& p) const;
531 
534  void compare(const Space& s, std::ostream& out) const;
537  void compare(const FlatZincSpace& s, std::ostream& out,
538  const Printer& p) const;
539 
548  void shrinkArrays(Printer& p);
549 
551  Meth method(void) const;
552 
554  int optVar(void) const;
556  bool optVarIsInt(void) const;
557 
567  void createBranchers(Printer& p, AST::Node* ann,
568  int seed, double decay,
569  bool ignoreUnknown,
570  std::ostream& err = std::cerr);
571 
573  AST::Array* solveAnnotations(void) const;
574 
576  BranchInformation branchInfo;
577 
579  virtual void constrain(const Space& s);
581  virtual Gecode::Space* copy(bool share);
583  virtual bool slave(const MetaInfo& mi);
584 
586 
587  IntArgs arg2intargs(AST::Node* arg, int offset = 0);
590  IntArgs arg2boolargs(AST::Node* arg, int offset = 0);
592  IntSet arg2intset(AST::Node* n);
594  IntSetArgs arg2intsetargs(AST::Node* arg, int offset = 0);
596  IntVarArgs arg2intvarargs(AST::Node* arg, int offset = 0);
598  BoolVarArgs arg2boolvarargs(AST::Node* arg, int offset = 0, int siv=-1);
600  BoolVar arg2BoolVar(AST::Node* n);
602  IntVar arg2IntVar(AST::Node* n);
604  bool isBoolArray(AST::Node* b, int& singleInt);
605 #ifdef GECODE_HAS_SET_VARS
606  SetVar arg2SetVar(AST::Node* n);
609  SetVarArgs arg2setvarargs(AST::Node* arg, int offset = 0, int doffset = 0,
610  const IntSet& od=IntSet::empty);
611 #endif
612 #ifdef GECODE_HAS_FLOAT_VARS
613  FloatValArgs arg2floatargs(AST::Node* arg, int offset = 0);
616  FloatVar arg2FloatVar(AST::Node* n);
618  FloatVarArgs arg2floatvarargs(AST::Node* arg, int offset = 0);
619 #endif
620  IntPropLevel ann2ipl(AST::Node* ann);
623  };
624 
627  private:
628  const std::string msg;
629  public:
630  Error(const std::string& where, const std::string& what)
631  : msg(where+": "+what) {}
632  const std::string& toString(void) const { return msg; }
633  };
634 
641  FlatZincSpace* parse(const std::string& fileName,
642  Printer& p, std::ostream& err = std::cerr,
643  FlatZincSpace* fzs=NULL, FznRnd* rnd=NULL);
644 
651  FlatZincSpace* parse(std::istream& is,
652  Printer& p, std::ostream& err = std::cerr,
653  FlatZincSpace* fzs=NULL, FznRnd* rnd=NULL);
654 
655 }}
656 
657 #endif
658 
659 // STATISTICS: flatzinc-any
Restart with linear sequence.
Definition: driver.hh:112
const std::string & toString(void) const
Definition: flatzinc.hh:632
Gecode::Driver::IntOption _solutions
How many solutions.
Definition: flatzinc.hh:234
int floatVarCount
Number of float variables.
Definition: flatzinc.hh:414
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:954
Options for running FlatZinc models
Definition: flatzinc.hh:230
RestartMode restart(void) const
Definition: flatzinc.hh:344
Gecode::Support::RandomGenerator random
The actual random number generator.
Definition: flatzinc.hh:387
The shared handle.
Definition: core.hpp:79
#define GECODE_FLATZINC_VERSION
Definition: config.hpp:17
Gecode::Driver::UnsignedIntOption _time
Cutoff for time.
Definition: flatzinc.hh:243
Gecode::Driver::BoolOption _allSolutions
Return all solutions.
Definition: flatzinc.hh:235
#define GECODE_HAS_SET_VARS
Definition: config.hpp:47
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:247
Meth _method
Whether to solve as satisfaction or optimization problem.
Definition: flatzinc.hh:424
Boolean option.
Definition: driver.hh:269
Group of branchers.
Definition: core.hpp:865
#define GECODE_FLATZINC_EXPORT
Definition: flatzinc.hh:79
Gecode::ScriptMode mode(void) const
Definition: flatzinc.hh:339
Passing float variables.
Definition: float.hh:981
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
int boolVarCount
Number of Boolean variables.
Definition: flatzinc.hh:412
Gecode::Driver::StringOption _restart
Restart method option.
Definition: flatzinc.hh:245
Gecode::Driver::BoolOption _free
Use free search.
Definition: flatzinc.hh:237
Integer variable array.
Definition: int.hh:744
Restart with Luby sequence.
Definition: driver.hh:113
Gecode::Driver::UnsignedIntOption _nogoods_limit
Depth limit for extracting no-goods.
Definition: flatzinc.hh:249
No restarts.
Definition: driver.hh:110
Gecode::Driver::BoolOption _stat
Emit statistics.
Definition: flatzinc.hh:257
A thread-safe random number generator.
Definition: flatzinc.hh:384
RestartMode
Different modes for restart-based search.
Definition: driver.hh:109
Gecode::Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition: flatzinc.hh:240
Float variable array.
Definition: float.hh:1031
Computation spaces.
Definition: core.hpp:1748
String-valued option.
Definition: driver.hh:151
Gecode::Driver::DoubleOption _decay
Decay option.
Definition: flatzinc.hh:238
void add(Driver::BaseOption &o)
Add new option o.
Definition: options.cpp:443
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
A mutex for mutual exclausion among several threads.
Definition: thread.hpp:99
Gecode::Support::Mutex mutex
A mutex for the random number generator.
Definition: flatzinc.hh:389
const BoolInstr * bi[]
Definition: mm-bool.cpp:4173
void value(int v)
Set default value to v.
Definition: options.hpp:78
unsigned int nogoods_limit(void) const
Definition: flatzinc.hh:350
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1446
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:256
Options opt
The options.
Definition: test.cpp:101
Print solution and some statistics.
Definition: driver.hh:99
Value description class for branching.
Definition: float.hh:1408
double threads(void) const
Definition: flatzinc.hh:329
Gecode::Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Definition: flatzinc.hh:242
int _optVar
Index of the variable to optimize.
Definition: flatzinc.hh:419
Output support class for FlatZinc interpreter.
Definition: flatzinc.hh:111
Base class for script options.
Definition: driver.hh:331
FznRnd * _random
Random number generator.
Definition: flatzinc.hh:433
Gecode::Driver::DoubleOption _step
Step option.
Definition: flatzinc.hh:251
const std::string & floatVarName(int i) const
Definition: flatzinc.hh:196
Error(const std::string &where, const std::string &what)
Definition: flatzinc.hh:630
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
const char * output(void) const
Definition: flatzinc.hh:338
Unsigned integer option.
Definition: driver.hh:229
Template for linear congruential generators.
Definition: random.hpp:50
Integer sets.
Definition: int.hh:174
unsigned int node(void) const
Definition: flatzinc.hh:333
const std::string & intVarName(int i) const
Definition: flatzinc.hh:191
Passing integer variables.
Definition: int.hh:639
Passing integer arguments.
Definition: int.hh:610
Passing Boolean variables.
Definition: int.hh:693
Gecode::Driver::IntOption _seed
Random seed.
Definition: flatzinc.hh:244
virtual void help(void)
Print help text.
Definition: flatzinc.hh:320
bool _optVarIsInt
Whether variable to optimize is integer (or float)
Definition: flatzinc.hh:421
void add(BrancherGroup bg, const std::string &rel0, const std::string &rel1, const std::vector< std::string > &n)
Add new brancher information.
Definition: flatzinc.cpp:286
Boolean variable array.
Definition: int.hh:789
Boolean integer variables.
Definition: int.hh:494
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition: options.cpp:510
String-valued option (integer value defined by strings)
Definition: driver.hh:174
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
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:250
Passing set variables.
Definition: set.hh:492
Print statistics for script.
Definition: driver.hh:101
BranchInformation(void)
Constructor.
Definition: flatzinc.cpp:273
Gecode::Driver::DoubleOption _r_base
Restart base.
Definition: flatzinc.hh:246
Set variables
Definition: set.hh:131
void value(const char *v)
Set default value to v.
Definition: options.cpp:96
unsigned int fail(void) const
Definition: flatzinc.hh:334
Restart with geometric sequence.
Definition: driver.hh:114
Gecode::Driver::BoolOption _nogoods
Whether to use no-goods.
Definition: flatzinc.hh:248
void init(void)
Initialise for use.
Definition: flatzinc.cpp:280
Integer variables.
Definition: int.hh:353
Gecode::Driver::DoubleOption _threads
How many threads to use.
Definition: flatzinc.hh:236
Exception class for FlatZinc errors
Definition: flatzinc.hh:626
AST::Array * _solveAnnotations
Annotations on the solve item.
Definition: flatzinc.hh:436
unsigned int c_d(void) const
Definition: flatzinc.hh:331
Gecode::Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition: flatzinc.hh:239
Run script in Gist.
Definition: driver.hh:102
void value(bool v)
Set default value to v.
Definition: options.hpp:128
double restart_base(void) const
Definition: flatzinc.hh:347
unsigned int time(void) const
Definition: flatzinc.hh:335
#define GECODE_HAS_FLOAT_VARS
Definition: config.hpp:26
Float variables.
Definition: float.hh:874
A space that can be initialized with a FlatZinc model.
Definition: flatzinc.hh:401
unsigned int restart_scale(void) const
Definition: flatzinc.hh:348
Set variable array
Definition: set.hh:572
CompareStatus compare(I &i, J &j)
Check whether range iterator i is a subset of j, or whether they are disjoint.
const std::string & setVarName(int i) const
Definition: flatzinc.hh:200
Gecode::Driver::StringValueOption _output
Output file.
Definition: flatzinc.hh:258
void print(const Brancher &b, unsigned int a, int i, int n, std::ostream &o) const
Output branch information.
Definition: flatzinc.cpp:293
Gecode toplevel namespace
int setVarCount
Number of set variables.
Definition: flatzinc.hh:416
int intVarCount
Number of integer variables.
Definition: flatzinc.hh:410
unsigned int a_d(void) const
Definition: flatzinc.hh:332
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76
A node in a FlatZinc abstract syntax tree.
Definition: ast.hh:71
Gecode::Driver::UnsignedIntOption _node
Cutoff for number of nodes.
Definition: flatzinc.hh:241
unsigned int _lns
Percentage of variables to keep in LNS (or 0 for no LNS)
Definition: flatzinc.hh:427
double FloatNum
Floating point number base type.
Definition: float.hh:110
const std::string & boolVarName(int i) const
Definition: flatzinc.hh:193
FlatZincOptions(const char *s)
Constructor.
Definition: flatzinc.hh:262
Restart with constant sequence.
Definition: driver.hh:111
Integer option.
Definition: driver.hh:209
IntSharedArray _lnsInitialSolution
Initial solution to start the LNS (or NULL for no LNS)
Definition: flatzinc.hh:430
void parse(int &argc, char *argv[])
Definition: flatzinc.hh:311
virtual void help(void)
Print help text.
Definition: options.cpp:463