22 #include <core/exception.h>
23 #include <navgraph/constraints/static_list_edge_cost_constraint.h>
53 edge_cost_list_buffer_.lock();
54 edge_cost_list_ = edge_cost_list_buffer_;
55 edge_cost_list_buffer_.unlock();
83 const std::vector<std::pair<fawkes::NavGraphEdge, float>> &edges)
85 for (
const std::pair<NavGraphEdge, float> &ec : edges) {
96 std::vector<std::pair<NavGraphEdge, float>>::iterator ec =
97 std::find_if(edge_cost_list_buffer_.begin(),
98 edge_cost_list_buffer_.end(),
99 [&edge](
const std::pair<fawkes::NavGraphEdge, float> &p) {
100 return p.first == edge;
103 if (ec != edge_cost_list_buffer_.end()) {
116 return (std::find_if(edge_cost_list_buffer_.begin(),
117 edge_cost_list_buffer_.end(),
118 [&edge](
const std::pair<fawkes::NavGraphEdge, float> &p) {
119 return p.first == edge;
121 != edge_cost_list_buffer_.end());
130 const std::vector<std::pair<fawkes::NavGraphEdge, float>> &
133 return edge_cost_list_;
140 if (!edge_cost_list_buffer_.empty()) {
142 edge_cost_list_buffer_.clear();
150 for (std::pair<NavGraphEdge, float> &ec : edge_cost_list_) {
151 if ((ec.first.from() == from.name() && ec.first.to() == to.name())
152 || (ec.first.from() == to.name() && ec.first.to() == from.name())) {