Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13
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  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #ifndef __GECODE_FLATZINC_HH__
39 #define __GECODE_FLATZINC_HH__
40 
41 #include <iostream>
42 
43 #include <gecode/kernel.hh>
44 #include <gecode/int.hh>
45 #ifdef GECODE_HAS_SET_VARS
46 #include <gecode/set.hh>
47 #endif
48 #ifdef GECODE_HAS_FLOAT_VARS
49 #include <gecode/float.hh>
50 #endif
51 #include <map>
52 
53 /*
54  * Support for DLLs under Windows
55  *
56  */
57 
58 #if !defined(GECODE_STATIC_LIBS) && \
59  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
60 
61 #ifdef GECODE_BUILD_FLATZINC
62 #define GECODE_FLATZINC_EXPORT __declspec( dllexport )
63 #else
64 #define GECODE_FLATZINC_EXPORT __declspec( dllimport )
65 #endif
66 
67 #else
68 
69 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
70 
71 #define GECODE_FLATZINC_EXPORT __attribute__ ((visibility("default")))
72 
73 #else
74 
75 #define GECODE_FLATZINC_EXPORT
76 
77 #endif
78 #endif
79 
80 // Configure auto-linking
81 #ifndef GECODE_BUILD_FLATZINC
82 #define GECODE_LIBRARY_NAME "FlatZinc"
84 #endif
85 
86 #include <gecode/driver.hh>
87 
89 #include <gecode/flatzinc/ast.hh>
91 
101 namespace Gecode { namespace FlatZinc {
102 
108  private:
110  std::vector<std::string> iv_names;
112  std::vector<std::string> bv_names;
113 #ifdef GECODE_HAS_FLOAT_VARS
114  std::vector<std::string> fv_names;
116 #endif
117 #ifdef GECODE_HAS_SET_VARS
118  std::vector<std::string> sv_names;
120 #endif
121  AST::Array* _output;
122  void printElem(std::ostream& out,
123  AST::Node* ai,
124  const Gecode::IntVarArray& iv,
125  const Gecode::BoolVarArray& bv
126 #ifdef GECODE_HAS_SET_VARS
127  ,
128  const Gecode::SetVarArray& sv
129 #endif
131  ,
132  const Gecode::FloatVarArray& fv
133 #endif
134  ) const;
135  void printElemDiff(std::ostream& out,
136  AST::Node* ai,
137  const Gecode::IntVarArray& iv1,
138  const Gecode::IntVarArray& iv2,
139  const Gecode::BoolVarArray& bv1,
140  const Gecode::BoolVarArray& bv2
141 #ifdef GECODE_HAS_SET_VARS
142  ,
143  const Gecode::SetVarArray& sv1,
144  const Gecode::SetVarArray& sv2
145 #endif
146 #ifdef GECODE_HAS_FLOAT_VARS
147  ,
148  const Gecode::FloatVarArray& fv1,
149  const Gecode::FloatVarArray& fv2
150 #endif
151  ) const;
152  public:
153  Printer(void) : _output(NULL) {}
154  void init(AST::Array* output);
155 
156  void print(std::ostream& out,
157  const Gecode::IntVarArray& iv,
158  const Gecode::BoolVarArray& bv
159 #ifdef GECODE_HAS_SET_VARS
160  ,
161  const Gecode::SetVarArray& sv
162 #endif
163 #ifdef GECODE_HAS_FLOAT_VARS
164  ,
165  const Gecode::FloatVarArray& fv
166 #endif
167  ) const;
168 
169  void printDiff(std::ostream& out,
170  const Gecode::IntVarArray& iv1, const Gecode::IntVarArray& iv2,
171  const Gecode::BoolVarArray& bv1, const Gecode::BoolVarArray& bv2
172 #ifdef GECODE_HAS_SET_VARS
173  ,
174  const Gecode::SetVarArray& sv1, const Gecode::SetVarArray& sv2
175 #endif
176 #ifdef GECODE_HAS_FLOAT_VARS
177  ,
178  const Gecode::FloatVarArray& fv1,
179  const Gecode::FloatVarArray& fv2
180 #endif
181  ) const;
182 
183 
184  ~Printer(void);
185 
186  void addIntVarName(const std::string& n);
187  const std::string& intVarName(int i) const { return iv_names[i]; }
188  void addBoolVarName(const std::string& n);
189  const std::string& boolVarName(int i) const { return bv_names[i]; }
190 #ifdef GECODE_HAS_FLOAT_VARS
191  void addFloatVarName(const std::string& n);
192  const std::string& floatVarName(int i) const { return fv_names[i]; }
193 #endif
194 #ifdef GECODE_HAS_SET_VARS
195  void addSetVarName(const std::string& n);
196  const std::string& setVarName(int i) const { return sv_names[i]; }
197 #endif
198 
199  void shrinkElement(AST::Node* node,
200  std::map<int,int>& iv, std::map<int,int>& bv,
201  std::map<int,int>& sv, std::map<int,int>& fv);
202 
203  void shrinkArrays(Space& home,
204  int& optVar, bool optVarIsInt,
207 #ifdef GECODE_HAS_SET_VARS
208  ,
210 #endif
211 #ifdef GECODE_HAS_FLOAT_VARS
212  ,
214 #endif
215  );
216 
217  private:
218  Printer(const Printer&);
219  Printer& operator=(const Printer&);
220  };
221 
227  protected:
229 
248 
249 
251 
255 
256 #ifdef GECODE_HAS_CPPROFILER
257 
261 
262 #endif
263 
265  public:
267  FlatZincOptions(const char* s)
268  : Gecode::BaseOptions(s),
269  _solutions("n","number of solutions (0 = all, -1 = one/best)",-1),
270  _allSolutions("a", "return all solutions (equal to -n 0)"),
271  _threads("p","number of threads (0 = #processing units)",
272  Gecode::Search::Config::threads),
273  _free("f", "free search, no need to follow search-specification"),
274  _decay("decay","decay factor",0.99),
275  _c_d("c-d","recomputation commit distance",Gecode::Search::Config::c_d),
276  _a_d("a-d","recomputation adaption distance",Gecode::Search::Config::a_d),
277  _node("node","node cutoff (0 = none, solution mode)"),
278  _fail("fail","failure cutoff (0 = none, solution mode)"),
279  _time("time","time (in ms) cutoff (0 = none, solution mode)"),
280  _seed("r","random seed",0),
281  _restart("restart","restart sequence type",RM_NONE),
282  _r_base("restart-base","base for geometric restart sequence",1.5),
283  _r_scale("restart-scale","scale factor for restart sequence",250),
284  _nogoods("nogoods","whether to use no-goods from restarts",false),
285  _nogoods_limit("nogoods-limit","depth limit for no-good extraction",
286  Search::Config::nogoods_limit),
287  _interrupt("interrupt","whether to catch Ctrl-C (true) or not (false)",
288  true),
289  _step("step","step distance for float optimization",0.0),
290  _mode("mode","how to execute script",Gecode::SM_SOLUTION),
291  _stat("s","emit statistics"),
292  _output("o","file to send output to")
293 
294 #ifdef GECODE_HAS_CPPROFILER
295  ,
296  _profiler_id("cpprofiler-id", "use this execution id with cpprofiler", 0),
297  _profiler_port("cpprofiler-port", "connect to cpprofiler on this port", 6565),
298  _profiler_info("cpprofiler-info", "send solution information to cpprofiler", false)
299 
300 #endif
301  {
302  _mode.add(Gecode::SM_SOLUTION, "solution");
303  _mode.add(Gecode::SM_STAT, "stat");
304  _mode.add(Gecode::SM_GIST, "gist");
305  _mode.add(Gecode::SM_CPPROFILER, "cpprofiler");
306  _restart.add(RM_NONE,"none");
307  _restart.add(RM_CONSTANT,"constant");
308  _restart.add(RM_LINEAR,"linear");
309  _restart.add(RM_LUBY,"luby");
310  _restart.add(RM_GEOMETRIC,"geometric");
311 
312  add(_solutions); add(_threads); add(_c_d); add(_a_d);
313  add(_allSolutions);
314  add(_free);
315  add(_decay);
316  add(_node); add(_fail); add(_time); add(_interrupt);
317  add(_seed);
318  add(_step);
319  add(_restart); add(_r_base); add(_r_scale);
320  add(_nogoods); add(_nogoods_limit);
321  add(_mode); add(_stat);
322  add(_output);
323 #ifdef GECODE_HAS_CPPROFILER
324  add(_profiler_id);
325  add(_profiler_port);
326  add(_profiler_info);
327 #endif
328  }
329 
330  void parse(int& argc, char* argv[]) {
331  Gecode::BaseOptions::parse(argc,argv);
332  if (_allSolutions.value() && _solutions.value()==-1) {
333  _solutions.value(0);
334  }
335  if (_stat.value())
336  _mode.value(Gecode::SM_STAT);
337  }
338 
339  virtual void help(void) {
340  std::cerr << "Gecode FlatZinc interpreter" << std::endl
341  << " - Supported FlatZinc version: " << GECODE_FLATZINC_VERSION
342  << std::endl << std::endl;
344  }
345 
346  int solutions(void) const { return _solutions.value(); }
347  bool allSolutions(void) const { return _allSolutions.value(); }
348  double threads(void) const { return _threads.value(); }
349  bool free(void) const { return _free.value(); }
350  unsigned int c_d(void) const { return _c_d.value(); }
351  unsigned int a_d(void) const { return _a_d.value(); }
352  unsigned int node(void) const { return _node.value(); }
353  unsigned int fail(void) const { return _fail.value(); }
354  unsigned int time(void) const { return _time.value(); }
355  int seed(void) const { return _seed.value(); }
356  double step(void) const { return _step.value(); }
357  const char* output(void) const { return _output.value(); }
358 
359  Gecode::ScriptMode mode(void) const {
360  return static_cast<Gecode::ScriptMode>(_mode.value());
361  }
362 
363  double decay(void) const { return _decay.value(); }
364  RestartMode restart(void) const {
365  return static_cast<RestartMode>(_restart.value());
366  }
367  void restart(RestartMode rm) {
368  _restart.value(rm);
369  }
370  double restart_base(void) const { return _r_base.value(); }
371  void restart_base(double d) { _r_base.value(d); }
372  unsigned int restart_scale(void) const { return _r_scale.value(); }
373  void restart_scale(int i) { _r_scale.value(i); }
374  bool nogoods(void) const { return _nogoods.value(); }
375  unsigned int nogoods_limit(void) const { return _nogoods_limit.value(); }
376  bool interrupt(void) const { return _interrupt.value(); }
377 
378 #ifdef GECODE_HAS_CPPROFILER
379 
380  int profiler_id(void) const { return _profiler_id.value(); }
381  unsigned int profiler_port(void) const { return _profiler_port.value(); }
382  bool profiler_info(void) const { return _profiler_info.value(); }
383 
384 #endif
385 
386  void allSolutions(bool b) { _allSolutions.value(b); }
387  };
388 
390  public:
392  BranchInformation(void);
396  void init(void);
398  void add(BrancherGroup bg,
399  const std::string& rel0,
400  const std::string& rel1,
401  const std::vector<std::string>& n);
403  void print(const Brancher& b,
404  unsigned int a, int i, int n, std::ostream& o) const;
405 #ifdef GECODE_HAS_FLOAT_VARS
406  void print(const Brancher& b,
408  unsigned int a, int i, const FloatNumBranch& nl,
409  std::ostream& o) const;
410 #endif
411  };
412 
415  extern Rnd defrnd;
416 
417  class FlatZincSpaceInitData;
418 
424  public:
425  enum Meth {
426  SAT, //< Solve as satisfaction problem
427  MIN, //< Solve as minimization problem
428  MAX //< Solve as maximization problem
429  };
430  protected:
441 
443  int _optVar;
446 
449 
451  unsigned int _lns;
452 
455 
458 
461 
464  private:
466  template<template<class> class Engine>
467  void
468  runEngine(std::ostream& out, const Printer& p,
469  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
471  template<template<class> class Engine,
472  template<class, template<class> class> class Meta>
473  void
474  runMeta(std::ostream& out, const Printer& p,
475  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
476  void
477  branchWithPlugin(AST::Node* ann);
478  public:
483 
486 
488  std::vector<bool> iv_introduced;
490  int* iv_boolalias;
496  std::vector<bool> bv_introduced;
497 #ifdef GECODE_HAS_SET_VARS
503  std::vector<bool> sv_introduced;
504 #endif
505 #ifdef GECODE_HAS_FLOAT_VARS
511  std::vector<bool> fv_introduced;
514 #endif
515  bool needAuxVars;
518  FlatZincSpace(Rnd& random = defrnd);
519 
521  ~FlatZincSpace(void);
522 
524  void init(int intVars, int boolVars, int setVars, int floatVars);
525 
527  void newIntVar(IntVarSpec* vs);
529  void aliasBool2Int(int iv, int bv);
531  int aliasBool2Int(int iv);
533  void newBoolVar(BoolVarSpec* vs);
535  void newSetVar(SetVarSpec* vs);
537  void newFloatVar(FloatVarSpec* vs);
538 
540  void postConstraints(std::vector<ConExpr*>& ces);
541 
543  void solve(AST::Array* annotation);
545  void minimize(int var, bool isInt, AST::Array* annotation);
547  void maximize(int var, bool isInt, AST::Array* annotation);
548 
550  void run(std::ostream& out, const Printer& p,
551  const FlatZincOptions& opt, Gecode::Support::Timer& t_total);
552 
554  void print(std::ostream& out, const Printer& p) const;
555 #ifdef GECODE_HAS_CPPROFILER
556  std::string getDomains(const Printer& p) const;
558 #endif
559  void compare(const Space& s, std::ostream& out) const;
564  void compare(const FlatZincSpace& s, std::ostream& out,
565  const Printer& p) const;
566 
575  void shrinkArrays(Printer& p);
576 
578  Meth method(void) const;
579 
581  int optVar(void) const;
583  bool optVarIsInt(void) const;
584 
594  void createBranchers(Printer& p, AST::Node* ann,
595  FlatZincOptions& opt, bool ignoreUnknown,
596  std::ostream& err = std::cerr);
597 
599  AST::Array* solveAnnotations(void) const;
600 
602  BranchInformation branchInfo;
603 
605  virtual void constrain(const Space& s);
607  virtual Gecode::Space* copy(void);
609  virtual bool slave(const MetaInfo& mi);
610 
612 
613  IntArgs arg2intargs(AST::Node* arg, int offset = 0);
616  IntSharedArray arg2intsharedarray(AST::Node* arg, int offset = 0);
618  IntArgs arg2boolargs(AST::Node* arg, int offset = 0);
620  IntSharedArray arg2boolsharedarray(AST::Node* arg, int offset = 0);
622  IntSet arg2intset(AST::Node* n);
624  IntSetArgs arg2intsetargs(AST::Node* arg, int offset = 0);
626  IntVarArgs arg2intvarargs(AST::Node* arg, int offset = 0);
628  BoolVarArgs arg2boolvarargs(AST::Node* arg, int offset = 0, int siv=-1);
630  BoolVar arg2BoolVar(AST::Node* n);
632  IntVar arg2IntVar(AST::Node* n);
634  TupleSet arg2tupleset(AST::Node* n, int noOfVars);
636  bool isBoolArray(AST::Node* b, int& singleInt);
637 #ifdef GECODE_HAS_SET_VARS
638  SetVar arg2SetVar(AST::Node* n);
641  SetVarArgs arg2setvarargs(AST::Node* arg, int offset = 0, int doffset = 0,
642  const IntSet& od=IntSet::empty);
643 #endif
644 #ifdef GECODE_HAS_FLOAT_VARS
645  FloatValArgs arg2floatargs(AST::Node* arg, int offset = 0);
648  FloatVar arg2FloatVar(AST::Node* n);
650  FloatVarArgs arg2floatvarargs(AST::Node* arg, int offset = 0);
651 #endif
652  IntPropLevel ann2ipl(AST::Node* ann);
655  DFA getSharedDFA(DFA& a);
657  };
658 
661  private:
662  const std::string msg;
663  public:
664  Error(const std::string& where, const std::string& what)
665  : msg(where+": "+what) {}
666  const std::string& toString(void) const { return msg; }
667  };
668 
675  FlatZincSpace* parse(const std::string& fileName,
676  Printer& p, std::ostream& err = std::cerr,
677  FlatZincSpace* fzs=NULL, Rnd& rnd=defrnd);
678 
685  FlatZincSpace* parse(std::istream& is,
686  Printer& p, std::ostream& err = std::cerr,
687  FlatZincSpace* fzs=NULL, Rnd& rnd=defrnd);
688 
689 }}
690 
691 #endif
692 
693 // STATISTICS: flatzinc-any
#define GECODE_FLATZINC_VERSION
Definition: config.hpp:17
Restart with linear sequence.
Definition: driver.hh:109
const std::string & toString(void) const
Definition: flatzinc.hh:666
Gecode::Driver::IntOption _solutions
How many solutions.
Definition: flatzinc.hh:230
int floatVarCount
Number of float variables.
Definition: flatzinc.hh:438
void value(int v)
Set default value to v.
Definition: options.hpp:58
const Gecode::FloatNum step
Definition: arithmetic.cpp:785
Passing float arguments.
Definition: float.hh:950
Options for running FlatZinc models
Definition: flatzinc.hh:226
RestartMode restart(void) const
Definition: flatzinc.hh:364
The shared handle.
Gecode::Driver::UnsignedIntOption _time
Cutoff for time.
Definition: flatzinc.hh:239
Gecode::Driver::BoolOption _allSolutions
Return all solutions.
Definition: flatzinc.hh:231
void value(double v)
Set default value to v.
Definition: options.hpp:108
ScriptMode
Different modes for executing scripts.
Definition: driver.hh:94
Gecode::Driver::UnsignedIntOption _r_scale
Restart scale factor.
Definition: flatzinc.hh:243
Meth _method
Whether to solve as satisfaction or optimization problem.
Definition: flatzinc.hh:448
Boolean option.
Definition: driver.hh:269
Group of branchers.
Definition: core.hpp:796
#define GECODE_FLATZINC_EXPORT
Definition: flatzinc.hh:75
Gecode::ScriptMode mode(void) const
Definition: flatzinc.hh:359
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, Rnd &rnd=defrnd)
Parse FlatZinc file fileName into fzs and return it.
Passing float variables.
Definition: float.hh:977
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
int boolVarCount
Number of Boolean variables.
Definition: flatzinc.hh:436
Gecode::Driver::StringOption _restart
Restart method option.
Definition: flatzinc.hh:241
Gecode::Driver::BoolOption _free
Use free search.
Definition: flatzinc.hh:233
Integer variable array.
Definition: int.hh:738
Restart with Luby sequence.
Definition: driver.hh:110
Gecode::Driver::UnsignedIntOption _nogoods_limit
Depth limit for extracting no-goods.
Definition: flatzinc.hh:245
bool profiler_info(void) const
Definition: flatzinc.hh:382
Definition: flatzinc.cpp:52
No restarts.
Definition: driver.hh:107
Rnd defrnd(0)
Uninitialized default random number generator.
Definition: flatzinc.hh:415
Gecode::Driver::BoolOption _stat
Emit statistics.
Definition: flatzinc.hh:253
RestartMode
Different modes for restart-based search.
Definition: driver.hh:106
Gecode::Driver::UnsignedIntOption _a_d
Adaptive recomputation distance.
Definition: flatzinc.hh:236
Float variable array.
Definition: float.hh:1027
Computation spaces.
Definition: core.hpp:1701
String-valued option.
Definition: driver.hh:151
unsigned int profiler_port(void) const
Definition: flatzinc.hh:381
Gecode::Driver::DoubleOption _decay
Decay option.
Definition: flatzinc.hh:234
void value(unsigned int v)
Set default value to v.
Definition: options.hpp:91
Gecode::IntSet d(v, 7)
const BoolInstr * bi[]
Definition: mm-bool.cpp:4169
void value(int v)
Set default value to v.
Definition: options.hpp:74
unsigned int nogoods_limit(void) const
Definition: flatzinc.hh:375
Gecode::Driver::IntOption _profiler_id
Use this execution id for the CP-profiler.
Definition: flatzinc.hh:258
Deterministic finite automaton (DFA)
Definition: int.hh:2023
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1401
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
#define GECODE_HAS_SET_VARS
Definition: config.hpp:56
Gecode::Driver::StringOption _mode
Script mode to run.
Definition: flatzinc.hh:252
Options opt
The options.
Definition: test.cpp:97
Gecode::Driver::BoolOption _profiler_info
Whether solution information should be sent to the CP-profiler.
Definition: flatzinc.hh:260
Print solution and some statistics.
Definition: driver.hh:95
Value description class for branching.
Definition: float.hh:1459
double threads(void) const
Definition: flatzinc.hh:348
void restart(RestartMode rm)
Definition: flatzinc.hh:367
Gecode::Driver::UnsignedIntOption _fail
Cutoff for number of failures.
Definition: flatzinc.hh:238
int _optVar
Index of the variable to optimize.
Definition: flatzinc.hh:443
Output support class for FlatZinc interpreter.
Definition: flatzinc.hh:107
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Definition: search.hh:113
Gecode::Driver::UnsignedIntOption _profiler_port
Connect to this port.
Definition: flatzinc.hh:259
Base class for script options.
Definition: driver.hh:331
Gecode::Driver::DoubleOption _step
Step option.
Definition: flatzinc.hh:247
const std::string & floatVarName(int i) const
Definition: flatzinc.hh:192
Error(const std::string &where, const std::string &what)
Definition: flatzinc.hh:664
const char * output(void) const
Definition: flatzinc.hh:357
Unsigned integer option.
Definition: driver.hh:229
FlatZincSpaceInitData * _initData
Initialisation data (only used for posting constraints)
Definition: flatzinc.hh:432
Integer sets.
Definition: int.hh:170
unsigned int node(void) const
Definition: flatzinc.hh:352
const std::string & intVarName(int i) const
Definition: flatzinc.hh:187
Passing integer variables.
Definition: int.hh:633
const double threads
Number of threads to use.
Definition: search.hh:108
Passing integer arguments.
Definition: int.hh:604
Passing Boolean variables.
Definition: int.hh:687
Gecode::Driver::IntOption _seed
Random seed.
Definition: flatzinc.hh:240
virtual void help(void)
Print help text.
Definition: flatzinc.hh:339
bool _optVarIsInt
Whether variable to optimize is integer (or float)
Definition: flatzinc.hh:445
Boolean variable array.
Definition: int.hh:783
Boolean integer variables.
Definition: int.hh:488
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Definition: options.cpp:540
Class represeting a set of tuples.
Definition: int.hh:2140
String-valued option (integer value defined by strings)
Definition: driver.hh:174
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:949
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:63
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Gecode::Driver::BoolOption _interrupt
Whether to catch SIGINT.
Definition: flatzinc.hh:246
Passing set variables.
Definition: set.hh:488
Print statistics for script.
Definition: driver.hh:97
Run script with CP-profiler.
Definition: driver.hh:99
Gecode::Driver::DoubleOption _r_base
Restart base.
Definition: flatzinc.hh:242
Set variables
Definition: set.hh:127
void value(const char *v)
Set default value to v.
Definition: options.cpp:113
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
unsigned int fail(void) const
Definition: flatzinc.hh:353
Restart with geometric sequence.
Definition: driver.hh:111
Gecode::Driver::BoolOption _nogoods
Whether to use no-goods.
Definition: flatzinc.hh:244
Integer variables.
Definition: int.hh:347
Gecode::Driver::DoubleOption _threads
How many threads to use.
Definition: flatzinc.hh:232
Exception class for FlatZinc errors
Definition: flatzinc.hh:660
AST::Array * _solveAnnotations
Annotations on the solve item.
Definition: flatzinc.hh:460
unsigned int c_d(void) const
Definition: flatzinc.hh:350
Gecode::Driver::UnsignedIntOption _c_d
Copy recomputation distance.
Definition: flatzinc.hh:235
Run script in Gist.
Definition: driver.hh:98
void value(bool v)
Set default value to v.
Definition: options.hpp:124
double restart_base(void) const
Definition: flatzinc.hh:370
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
Definition: search.hh:111
unsigned int time(void) const
Definition: flatzinc.hh:354
Float variables.
Definition: float.hh:870
Rnd _random
Random number generator.
Definition: flatzinc.hh:457
#define GECODE_HAS_FLOAT_VARS
Definition: config.hpp:35
A space that can be initialized with a FlatZinc model.
Definition: flatzinc.hh:423
unsigned int restart_scale(void) const
Definition: flatzinc.hh:372
Set variable array
Definition: set.hh:568
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:196
Gecode::Driver::StringValueOption _output
Output file.
Definition: flatzinc.hh:254
Gecode toplevel namespace
int setVarCount
Number of set variables.
Definition: flatzinc.hh:440
int intVarCount
Number of integer variables.
Definition: flatzinc.hh:434
unsigned int a_d(void) const
Definition: flatzinc.hh:351
#define GECODE_VTABLE_EXPORT
Definition: support.hh:72
A node in a FlatZinc abstract syntax tree.
Definition: ast.hh:67
const unsigned int nogoods_limit
Depth limit for no-good generation during search.
Definition: search.hh:129
Gecode::Driver::UnsignedIntOption _node
Cutoff for number of nodes.
Definition: flatzinc.hh:237
Random number generator.
Definition: rnd.hpp:42
unsigned int _lns
Percentage of variables to keep in LNS (or 0 for no LNS)
Definition: flatzinc.hh:451
double FloatNum
Floating point number base type.
Definition: float.hh:106
const std::string & boolVarName(int i) const
Definition: flatzinc.hh:189
FlatZincOptions(const char *s)
Constructor.
Definition: flatzinc.hh:267
Restart with constant sequence.
Definition: driver.hh:108
Integer option.
Definition: driver.hh:209
IntSharedArray _lnsInitialSolution
Initial solution to start the LNS (or NULL for no LNS)
Definition: flatzinc.hh:454
void parse(int &argc, char *argv[])
Definition: flatzinc.hh:330
virtual void help(void)
Print help text.
Definition: options.cpp:486