44 #ifndef ILQGAMES_GUI_COST_INSPECTOR_H 45 #define ILQGAMES_GUI_COST_INSPECTOR_H 47 #include <ilqgames/cost/player_cost.h> 48 #include <ilqgames/dynamics/multi_player_flat_system.h> 49 #include <ilqgames/gui/control_sliders.h> 50 #include <ilqgames/utils/operating_point.h> 51 #include <ilqgames/utils/player_cost_cache.h> 52 #include <ilqgames/utils/solver_log.h> 53 #include <ilqgames/utils/types.h> 55 #include <glog/logging.h> 56 #include <imgui/imgui.h> 68 CostInspector(
const std::shared_ptr<const ControlSliders>& sliders,
69 const std::vector<std::vector<PlayerCost>>& player_costs)
73 selected_cost_name_(
"<Please select a cost>") {
74 CHECK_NOTNULL(sliders_.get());
75 CHECK_EQ(player_costs.size(), sliders_->NumProblems());
77 player_costs_.resize(sliders_->NumProblems());
78 for (
size_t problem_idx = 0; problem_idx < sliders_->NumProblems();
80 for (
const auto& log : sliders_->LogsForEachProblem()[problem_idx])
81 player_costs_[problem_idx].emplace_back(log, player_costs[problem_idx]);
90 const std::shared_ptr<const ControlSliders> sliders_;
93 std::vector<std::vector<PlayerCostCache>> player_costs_;
96 mutable size_t selected_problem_;
97 mutable PlayerIndex selected_player_;
98 mutable std::string selected_cost_name_;