MCPcopy Create free account
hub / github.com/Gecode/gecode / choice

Method choice

gecode/flatzinc/flatzinc.cpp:189–209  ·  view source on GitHub ↗

Return choice

Source from the content-addressed store, hash-verified

187 }
188 /// Return choice
189 virtual Choice* choice(Space& home) {
190 done = true;
191 FlatZincSpace& fzs = static_cast<FlatZincSpace&>(*home.clone());
192 fzs.needAuxVars = false;
193 branch(fzs,fzs.iv_aux,int_varsel,int_valsel);
194 branch(fzs,fzs.bv_aux,bool_varsel,bool_valsel);
195#ifdef GECODE_HAS_SET_VARS
196 branch(fzs,fzs.sv_aux,set_varsel,set_valsel);
197#endif
198#ifdef GECODE_HAS_FLOAT_VARS
199 branch(fzs,fzs.fv_aux,float_varsel,float_valsel);
200#endif
201 Search::Options opt; opt.clone = false;
202 FlatZincSpace* sol = dfs(&fzs, opt);
203 if (sol) {
204 delete sol;
205 return new Choice(*this,false);
206 } else {
207 return new Choice(*this,true);
208 }
209 }
210 /// Return choice
211 virtual Choice* choice(const Space&, Archive& e) {
212 bool fail; e >> fail;

Callers

nothing calls this directly

Calls 3

branchFunction · 0.70
dfsFunction · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected