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

Function listAssignments

contribs/qecode/examples/network-pricing2.cpp:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51vector<int> assignment;
52void listAssignments(Strategy s) {
53 StrategyNode tag = s.getTag();
54 if (s.isTrue()) {
55 // We are at the end of a branch : we print the assignment)
56 for (int i=0;i<assignment.size();++i) cout<<assignment[i]<<" ";
57 cout<<endl;
58 return;
59 }
60 if (assignment.size()<= tag.Vmax) assignment.resize(tag.Vmax + 1);
61 for (int i=tag.Vmin;i<=tag.Vmax;++i) {
62 assignment[i] = tag.valeurs[i-(tag.Vmin)];
63 }
64 // recursively extracting each child
65 for (int i=0;i<s.degree();++i) {
66 listAssignments(s.getChild(i));
67 }
68}
69
70int main() {
71 int NCustomer = 2;

Callers 1

mainFunction · 0.85

Calls 5

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

Tested by

no test coverage detected