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

Method getVal

contribs/qecode/OptVar.cc:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int ExistOptVar::getVal(Strategy s) {
31// cout<<"getval on existoptvar "<<varId<<" at scope "<<scopeId<<endl;
32 if (s.isTrue()) {cout<<"EOV "<<varId<<" scope "<<scopeId<<" try to get opt value on TRUE"<<endl;abort();}
33 if (s.isFalse()) {cout<<"EOV "<<varId<<" scope "<<scopeId<<"Try to get opt value on FALSE"<<endl;abort();} // (sub)Strategy must neither be false
34 if (s.isDummy()) {cout<<"EOV "<<varId<<" scope "<<scopeId<<"Try to get opt value on Dummy"<<endl;abort();} // nor begin with a universal scope
35 if (s.scope() > scopeId) {cout<<"EOV "<<varId<<" scope "<<scopeId<<"Try to get opt value on asubstrategy not containing opt variable"<<endl;abort();} // nor begin at a scope after the one we want ^^
36
37 if (s.scope() == scopeId) return s.value(varId-s.VMin());
38 // s.getTag() < scope
39 Strategy nextScope = s.getChild(0);
40
41 return getVal(nextScope);
42}
43
44int ExistOptVar::getScope() {return scopeId;}
45

Callers 1

rSolveMethod · 0.45

Calls 5

valueMethod · 0.45
getChildMethod · 0.45
clearMethod · 0.45
degreeMethod · 0.45
quantifierMethod · 0.45

Tested by

no test coverage detected