38 using namespace Gecode;
51 static const int nl = 10;
64 d(le[0]), o(le[1]),
n(le[2]),
a(le[3]),
l(le[4]),
65 g(le[5]), e(le[6]),
r(le[7]),
b(le[8]),
t(le[9]);
72 switch (
opt.model()) {
74 rel(*
this, 100000*
d+10000*o+1000*
n+100*
a+10*
l+
d
75 + 100000*g+10000*e+1000*
r+100*
a+10*
l+
d
76 == 100000*
r+10000*o+1000*
b+100*e+10*
r+
t,
81 IntVar c0(*
this,0,1), c1(*
this,0,1), c2(*
this,0,1),
82 c3(*
this,0,1), c4(*
this,0,1);
85 rel(*
this, c1+
a+
a == e+10*c2,
opt.ipl());
87 rel(*
this, c3+o+e == o+10*c4,
opt.ipl());
108 os <<
"\t" << le << std::endl;;
126 Script::run<Donald,DFS,Options>(
opt);
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Example: DONALD+GERALD=ROBERT puzzle
Donald(const Options &opt)
Actual model.
int main(int argc, char *argv[])
Main-function.
virtual Space * copy(void)
Copy during cloning.
Donald(Donald &s)
Constructor for cloning s.
virtual void print(std::ostream &os) const
Print solution.
@ MODEL_CARRY
Use carries.
@ MODEL_SINGLE
Use single linear equation.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Parametric base-class for scripts.
void iterations(unsigned int i)
Set default number of iterations.
void solutions(unsigned int n)
Set default number of solutions to search for.
void model(int v)
Set default model value.
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
IntValBranch INT_VAL_MAX(void)
Select largest value.
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
#define GECODE_NEVER
Assert that this command is never executed.