Public Member Functions | Protected Attributes | List of all members
f2c::rp::RoutePlannerBase Class Reference

#include <route_planner_base.h>

Public Member Functions

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
 
virtual F2CGraph2D createCoverageGraph (const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, F2CGraph2D &shortest_graph, double d_tol, bool redirect_swaths=true) const
 
virtual F2CGraph2D createShortestGraph (const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, double d_tol) const
 
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)
 
void setStartAndEndPoint (const F2CPoint &p)
 Set the start and the end of the route. More...
 
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. More...
 
virtual ~RoutePlannerBase ()=default
 

Protected Attributes

std::optional< F2CPointr_start_end
 

Detailed Description

Definition at line 23 of file route_planner_base.h.

Constructor & Destructor Documentation

◆ ~RoutePlannerBase()

virtual f2c::rp::RoutePlannerBase::~RoutePlannerBase ( )
virtualdefault

Member Function Documentation

◆ computeBestRoute()

std::vector< long long int > f2c::rp::RoutePlannerBase::computeBestRoute ( const F2CGraph2D cov_graph,
bool  show_log,
long int  time_limit_seconds,
bool  use_guided_local_search = true 
) const
virtual

Use the optimizer to generate the index of the points of the best coverage route.

Parameters
cov_graphGraph representing the coverage problem
show_logWhether to show optimization logs
time_limit_secondsMaximum time to spend on optimization
use_guided_local_searchIf true, uses guided local search which may take longer but can find more optimal solutions. If false, uses automatic search which is faster but may find less optimal solutions.

Definition at line 149 of file route_planner_base.cpp.

◆ createCoverageGraph()

F2CGraph2D f2c::rp::RoutePlannerBase::createCoverageGraph ( const F2CCells cells,
const F2CSwathsByCells swaths_by_cells,
F2CGraph2D shortest_graph,
double  d_tol,
bool  redirect_swaths = true 
) const
virtual

Create graph to compute the cost of covering the swaths in a given order.

Parameters
cellsHeadland swath rings used to travel through the headlands
swaths_by_cellsSwaths to be covered.
shortest_graphGraph to compute the shortest path between two nodes.
d_tolTolerance distance to consider if two points are the same.

Definition at line 91 of file route_planner_base.cpp.

◆ createShortestGraph()

F2CGraph2D f2c::rp::RoutePlannerBase::createShortestGraph ( const F2CCells cells,
const F2CSwathsByCells swaths_by_cells,
double  d_tol 
) const
virtual

Create graph to compute the shortest path between two points in the headlands.

Parameters
cellsHeadland swath rings used to travel through the headlands
swaths_by_cellsSwaths to be covered.
d_tolTolerance distance to consider if two points are the same.

Definition at line 40 of file route_planner_base.cpp.

◆ genRoute()

F2CRoute f2c::rp::RoutePlannerBase::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 
)
virtual

Generate route to cover the swaths on a field. If two consecutive swaths are far away, the route connects both through the headland.

Parameters
cellsHeadland swath rings used to travel through the headlands
swaths_by_cellsSwaths to be covered.
show_logShow log from the optimizer
d_tolTolerance distance to consider if two points are the same.
redirect_swathsWhether to allow redirecting swaths
time_limit_secondsMaximum time to spend on optimization
search_for_optimumIf true, uses guided local search which may take longer but can find more optimal solutions. If false, uses automatic search which is faster but may find less optimal solutions.
Returns
Route that covers all the swaths

Definition at line 21 of file route_planner_base.cpp.

◆ setStartAndEndPoint()

void f2c::rp::RoutePlannerBase::setStartAndEndPoint ( const F2CPoint p)

Set the start and the end of the route.

Definition at line 36 of file route_planner_base.cpp.

◆ transformSolutionToRoute()

F2CRoute f2c::rp::RoutePlannerBase::transformSolutionToRoute ( const std::vector< long long int > &  route_ids,
const F2CSwathsByCells swaths_by_cells,
const F2CGraph2D coverage_graph,
F2CGraph2D shortest_graph 
) const
virtual

Tranform index of points to an actual Route.

Definition at line 193 of file route_planner_base.cpp.

Member Data Documentation

◆ r_start_end

std::optional<F2CPoint> f2c::rp::RoutePlannerBase::r_start_end
protected

Definition at line 92 of file route_planner_base.h.


The documentation for this class was generated from the following files:


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