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

Function printStr

contribs/qecode/examples/network-pricing1.cpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31using namespace Gecode::Int;
32
33void printStr(Strategy s,int depth) {
34 StrategyNode plop = s.getTag();
35 for (int glou=0;glou<depth;glou++) cout<<" ";
36 if (s.isTrue()) cout<<"TRUE"<<endl;
37 else if (s.isFalse()) cout<<"FALSE"<<endl;
38 else cout<<"type "<<plop.type<<" qt "<<plop.quantifier<<" vmin "<<plop.Vmin<<" vmax "<<plop.Vmax<<" scope "<<plop.scope<<" - ";
39 for (int i=0;i<s.getTag().valeurs.size();i++) cout<<s.getTag().valeurs[i]<<" ";
40 cout<<endl;
41 for (int glou=0;glou<depth;glou++) cout<<" ";
42 cout<<s.degree()<<" child(ren)"<<endl;
43 for (int i=0;i<s.degree();i++) {
44 for (int glou=0;glou<depth;glou++) cout<<" ";
45 cout<<"Child "<<i<<" : "<<endl;
46 printStr(s.getChild(i),depth+1);
47 }
48}
49/////////////////////////////////////////////////////////////////////////////////////////
50// This is an instance of the Network Pricing Problem, taken from : //
51// //

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