Skip to content

Commit

Permalink
Add intermediate solutions in output log.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Sep 4, 2024
1 parent 0b367fb commit cd9d513
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/output_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ rapidjson::Value to_json(const std::vector<ls::log::Step<Route>>& steps,

json_step.AddMember("score", json_score, allocator);

if (step.solution.has_value()) {
rapidjson::Value step_solution(rapidjson::kObjectType);
auto json_solution = to_json(step.solution.value(), false);
step_solution.CopyFrom(json_solution, allocator);

json_step.AddMember("solution", step_solution, allocator);
}

json_LS_steps.PushBack(json_step, allocator);
}

Expand Down

0 comments on commit cd9d513

Please sign in to comment.