route_planner_base.h
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #pragma once
8 #ifndef FIELDS2COVER_ROUTE_PLANNING_ROUTE_PLANNING_BASE_H_
9 #define FIELDS2COVER_ROUTE_PLANNING_ROUTE_PLANNING_BASE_H_
10 
11 #include <vector>
12 #include <map>
13 #include <optional>
14 #include <limits>
15 #include <utility>
16 #include "fields2cover/types.h"
20 
21 namespace f2c::rp {
22 
24  public:
39  virtual F2CRoute genRoute(
40  const F2CCells& cells, const F2CSwathsByCells& swaths_by_cells,
41  bool show_log = false, double d_tol = 1e-4, bool redirect_swaths = true,
42  long int time_limit_seconds = 1, bool search_for_optimum = false);
43 
45  void setStartAndEndPoint(const F2CPoint& p);
46 
54  const F2CCells& cells, const F2CSwathsByCells& swaths_by_cells,
55  double d_tol) const;
56 
65  const F2CCells& cells, const F2CSwathsByCells& swaths_by_cells,
66  F2CGraph2D& shortest_graph,
67  double d_tol, bool redirect_swaths = true) const;
68 
69 
70  virtual ~RoutePlannerBase() = default;
71 
80  virtual std::vector<long long int> computeBestRoute(
81  const F2CGraph2D& cov_graph, bool show_log, long int time_limit_seconds,
82  bool use_guided_local_search = true) const;
83 
86  const std::vector<long long int>& route_ids,
87  const F2CSwathsByCells& swaths_by_cells,
88  const F2CGraph2D& coverage_graph,
89  F2CGraph2D& shortest_graph) const;
90 
91  protected:
92  std::optional<F2CPoint> r_start_end;
93 };
94 
95 
96 
97 } // namespace f2c::rp
98 
99 #endif // FIELDS2COVER_ROUTE_PLANNING_ROUTE_PLANNING_BASE_H_
100 
f2c::types::Graph2D
Definition: Graph2D.h:18
1_basic_types.cells
cells
Definition: 1_basic_types.py:93
f2c::rp::RoutePlannerBase::createCoverageGraph
virtual F2CGraph2D createCoverageGraph(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, F2CGraph2D &shortest_graph, double d_tol, bool redirect_swaths=true) const
Definition: route_planner_base.cpp:91
f2c::rp::RoutePlannerBase::createShortestGraph
virtual F2CGraph2D createShortestGraph(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, double d_tol) const
Definition: route_planner_base.cpp:40
types.h
f2c::rp::RoutePlannerBase::transformSolutionToRoute
virtual F2CRoute transformSolutionToRoute(const std::vector< long long int > &route_ids, const F2CSwathsByCells &swaths_by_cells, const F2CGraph2D &coverage_graph, F2CGraph2D &shortest_graph) const
Tranform index of points to an actual Route.
Definition: route_planner_base.cpp:193
f2c::rp::RoutePlannerBase::~RoutePlannerBase
virtual ~RoutePlannerBase()=default
f2c::rp::RoutePlannerBase::r_start_end
std::optional< F2CPoint > r_start_end
Definition: route_planner_base.h:92
f2c::rp::RoutePlannerBase::setStartAndEndPoint
void setStartAndEndPoint(const F2CPoint &p)
Set the start and the end of the route.
Definition: route_planner_base.cpp:36
f2c::rp::RoutePlannerBase::computeBestRoute
virtual std::vector< long long int > computeBestRoute(const F2CGraph2D &cov_graph, bool show_log, long int time_limit_seconds, bool use_guided_local_search=true) const
Definition: route_planner_base.cpp:149
f2c::rp::RoutePlannerBase::genRoute
virtual F2CRoute genRoute(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, bool show_log=false, double d_tol=1e-4, bool redirect_swaths=true, long int time_limit_seconds=1, bool search_for_optimum=false)
Definition: route_planner_base.cpp:21
f2c::rp
Route planning algorithms' namespace.
Definition: boustrophedon_order.h:14
f2c::types::Cells
Definition: Cells.h:21
f2c::types::Route
Definition: Route.h:23
f2c::types::Point
Definition: Point.h:21
f2c::types::SwathsByCells
Definition: SwathsByCells.h:17
single_cell_swaths_order_base.h
rp_objective.h
direct_dist_path_obj.h
f2c::rp::RoutePlannerBase
Definition: route_planner_base.h:23


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31