| 514 | } |
| 515 | |
| 516 | LocalSearch::Statistics LocalSearch::statistics() const |
| 517 | { |
| 518 | size_t numMoves = 0; |
| 519 | size_t numImproving = 0; |
| 520 | |
| 521 | auto const count = [&](auto const *op) |
| 522 | { |
| 523 | auto const &stats = op->statistics(); |
| 524 | numMoves += stats.numEvaluations; |
| 525 | numImproving += stats.numApplications; |
| 526 | }; |
| 527 | |
| 528 | std::for_each(nodeOps.begin(), nodeOps.end(), count); |
| 529 | std::for_each(routeOps.begin(), routeOps.end(), count); |
| 530 | |
| 531 | assert(numImproving <= numUpdates_); |
| 532 | return {numMoves, numImproving, numUpdates_}; |
| 533 | } |
| 534 | |
| 535 | LocalSearch::LocalSearch(ProblemData const &data, |
| 536 | SearchSpace::Neighbours neighbours, |