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

Function printStr

contribs/qecode/examples/stress_test.cpp:31–46  ·  view source on GitHub ↗

This function prints a winning strategy.

Source from the content-addressed store, hash-verified

29
30// This function prints a winning strategy.
31void printStr(Strategy s,int depth=0) {
32 StrategyNode plop = s.getTag();
33 for (int glou=0;glou<depth;glou++) cout<<" ";
34 if (s.isTrue()) cout<<"TRUE"<<endl;
35 else if (s.isFalse()) cout<<"FALSE"<<endl;
36 else cout<<"type "<<plop.type<<" qt "<<plop.quantifier<<" vmin "<<plop.Vmin<<" vmax "<<plop.Vmax<<" scope "<<plop.scope<<" - ";
37 for (int i=0;i<s.getTag().valeurs.size();i++) cout<<s.getTag().valeurs[i]<<" ";
38 cout<<endl;
39 for (int glou=0;glou<depth;glou++) cout<<" ";
40 cout<<s.degree()<<" child(ren)"<<endl;
41 for (int i=0;i<s.degree();i++) {
42 for (int glou=0;glou<depth;glou++) cout<<" ";
43 cout<<"Child "<<i<<" : "<<endl;
44 printStr(s.getChild(i),depth+1);
45 }
46}
47
48// This is a set of tiny problems which are used to dtect errors in QeCode.
49// This set is likely to progressively enlarge...

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