42 using namespace Gecode;
50 PhotoSpec(
const int n_n,
const int n_p,
const int* p)
51 : n_names(n_n), n_prefs(n_p), prefs(p) {}
56 0,2, 1,4, 2,3, 2,4, 3,0, 4,3, 4,0, 4,1
63 0,2, 0,4, 0,7, 1,4, 1,8, 2,3, 2,4, 3,0, 3,4,
64 4,5, 4,0, 5,0, 5,8, 6,2, 6,7, 7,8, 7,6
98 pos(*this,spec.n_names, 0, spec.n_names-1),
99 violations(*this,0,spec.n_prefs)
103 for (
int i=0;
i<spec.n_prefs;
i++) {
104 int pa = spec.prefs[2*
i+0];
105 int pb = spec.prefs[2*
i+1];
108 rel(*
this, violations ==
sum(viol));
126 pos.update(*
this, share, s.
pos);
127 violations.update(*
this, share, s.
violations);
132 return new Photo(share,*
this);
137 os <<
"\tpos[] = " <<
pos << std::endl
138 <<
"\tviolations: " << violations << std::endl;
159 opt.
parse(argc,argv);
160 MaximizeScript::run<Photo,BAB,SizeOptions>(
opt);