55 void parse(
int& argc,
char* argv[]) {
65 std::cerr <<
"\t(unsigned int) default: " << c << std::endl
66 <<
"\t\tparameter c (number of boxes)" << std::endl
67 <<
"\t(unsigned int) default: " << n << std::endl
68 <<
"\t\tparameter n (number of balls)" << std::endl;
99 for (
int i=1;
i<=
n;
i++) {
100 triple[0] = box[
i-1];
101 for (
int j=1;
i+j<=
n; j++) {
102 triple[1] = box[j-1];
103 triple[2] = box[
i+j-1];
116 os <<
"\t" << box << std::endl;
126 return new Schur(share,*
this);
136 opt.
parse(argc,argv);
137 Script::run<Schur,DFS,SchurOptions>(
opt);
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
virtual Space * copy(bool share)
Copy during cloning.
virtual void help(void)
Print help message.
Parametric base-class for scripts.
void decay(double d)
Set default decay factor.
void update(Space &, bool share, VarArray< Var > &a)
Update array to be a clone of array a.
Gecode::FloatVal c(-8, 8)
Schur(bool share, Schur &s)
Constructor for cloning s.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
IntVarArray box
Array of box per ball.
IntValBranch INT_VAL_MIN(void)
Select smallest value.
void precede(Home home, const IntVarArgs &x, int s, int t, IntConLevel)
Post propagator that s precedes t in x.
Passing integer variables.
int main(int argc, char *argv[])
Main-function.
void parse(int &argc, char *argv[])
Parse options from arguments argv (number is argc)
Options for Schur's Lemma
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Schur(const SchurOptions &opt)
Actual model.
Gecode toplevel namespace
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.
int n
Parameters to be given on command line Initialize options for example with name s.
virtual void print(std::ostream &os) const
Print solution.
virtual void help(void)
Print help text.