55 static const int nl = 10;
68 d(le[0]), o(le[1]),
n(le[2]),
a(le[3]),
l(le[4]),
69 g(le[5]), e(le[6]),
r(le[7]),
b(le[8]),
t(le[9]);
76 switch (opt.
model()) {
78 rel(*
this, 100000*
d+10000*o+1000*
n+100*
a+10*
l+
d
79 + 100000*g+10000*e+1000*
r+100*
a+10*
l+
d
80 == 100000*
r+10000*o+1000*
b+100*e+10*
r+t,
85 IntVar c0(*
this,0,1), c1(*
this,0,1), c2(*
this,0,1),
86 c3(*
this,0,1), c4(*
this,0,1);
87 rel(*
this,
d+
d == t+10*c0, opt.
icl());
89 rel(*
this, c1+
a+
a == e+10*c2, opt.
icl());
91 rel(*
this, c3+o+e == o+10*c4, opt.
icl());
102 le.
update(*
this, share, s.le);
107 return new Donald(share,*
this);
112 os <<
"\t" << le << std::endl;;
129 opt.
parse(argc,argv);
130 Script::run<Donald,DFS,Options>(
opt);
virtual void print(std::ostream &os) const
Print solution.
Donald(const Options &opt)
Actual model.
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Parametric base-class for scripts.
void iterations(unsigned int i)
Set default number of iterations.
virtual Space * copy(bool share)
Copy during cloning.
void update(Space &, bool share, VarArray< Var > &a)
Update array to be a clone of array a.
int n
Number of negative literals for node type.
Use single linear equation.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
IntValBranch INT_VAL_MAX(void)
Select largest value.
Example: DONALD+GERALD=ROBERT puzzle
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
void distinct(Home home, const IntVarArgs &x, IntConLevel icl)
Post propagator for for all .
void solutions(unsigned int n)
Set default number of solutions to search for.
void model(int v)
Set default model value.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
Donald(bool share, Donald &s)
Constructor for cloning s.
BrancherHandle branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
#define GECODE_NEVER
Assert that this command is never executed.
void icl(IntConLevel i)
Set default integer consistency level.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
int main(int argc, char *argv[])
Main-function.