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

Function printStr

contribs/qecode/examples/optim2.cc:34–49  ·  view source on GitHub ↗

This function prints a winning strategy.

Source from the content-addressed store, hash-verified

32
33// This function prints a winning strategy.
34void printStr(Strategy s,int depth=0) {
35 StrategyNode plop = s.getTag();
36 for (int glou=0;glou<depth;glou++) cout<<" ";
37 if (s.isTrue()) cout<<"TRUE"<<endl;
38 else if (s.isFalse()) cout<<"FALSE"<<endl;
39 else cout<<"type "<<plop.type<<" qt "<<plop.quantifier<<" vmin "<<plop.Vmin<<" vmax "<<plop.Vmax<<" scope "<<plop.scope<<" - ";
40 for (int i=0;i<s.getTag().valeurs.size();i++) cout<<s.getTag().valeurs[i]<<" ";
41 cout<<endl;
42 for (int glou=0;glou<depth;glou++) cout<<" ";
43 cout<<s.degree()<<" child(ren)"<<endl;
44 for (int i=0;i<s.degree();i++) {
45 for (int glou=0;glou<depth;glou++) cout<<" ";
46 cout<<"Child "<<i<<" : "<<endl;
47 printStr(s.getChild(i),depth+1);
48 }
49}
50
51int main() {
52 int NCustomer = 2;

Callers 1

mainFunction · 0.70

Calls 4

getTagMethod · 0.45
sizeMethod · 0.45
degreeMethod · 0.45
getChildMethod · 0.45

Tested by

no test coverage detected