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

Method print

examples/open-shop.cpp:277–296  ·  view source on GitHub ↗

Print solution

Source from the content-addressed store, hash-verified

275
276 /// Print solution
277 virtual void
278 print(std::ostream& os) const {
279 Region re;
280 PrintTask* m = re.alloc<PrintTask>(spec.n);
281 for (int i=0; i<spec.m; i++) {
282 int k=0;
283 for (int j=0; j<spec.n; j++) {
284 m[k].start = _start[i*spec.n+j].val();
285 m[k].job = j;
286 m[k].p = spec.p[i*spec.n+j];
287 k++;
288 }
289 Support::quicksort(m, spec.n, m[0]);
290 os << "Machine " << i << ": ";
291 for (int j=0; j<spec.n; j++)
292 os << "\t" << m[j].job << "("<<m[j].p<<")";
293 os << " = " << m[spec.n-1].start+m[spec.n-1].p << std::endl;
294 }
295 os << "Makespan: " << makespan << std::endl;
296 }
297
298};
299

Callers

nothing calls this directly

Calls 2

quicksortFunction · 0.85
valMethod · 0.45

Tested by

no test coverage detected