Print solution
| 223 | } |
| 224 | /// Print solution |
| 225 | virtual void |
| 226 | print(std::ostream& os) const { |
| 227 | std::vector<std::list<int> > period(curr.p); |
| 228 | for (int i=x.size(); i--;) |
| 229 | period[x[i].val()].push_back(i); |
| 230 | |
| 231 | os << "Solution with load " << u.val() << ":" << std::endl; |
| 232 | for (int i=0; i<curr.p; i++) { |
| 233 | os << "\tPeriod "<<i+1<<": "; |
| 234 | for (std::list<int>::iterator v=period[i].begin(); |
| 235 | v != period[i].end(); ++v) { |
| 236 | os << curr.courses[*v].name << " "; |
| 237 | } |
| 238 | os << std::endl; |
| 239 | } |
| 240 | os << std::endl; |
| 241 | } |
| 242 | |
| 243 | }; |
| 244 |