Datafiles for: "Lawn map data: an artificial dataset for the Coverage Path Planning Problem "
收藏资源简介:
Data files for the paper "Lawn map data: an artificial dataset for the Coverage Path Planning Problem" File structure: The main data (1918 .json files) are contained in the instances folder. The naming convention for the instances is the following: {a}.holes_{b}_angle_{c}_width_{d}_areas_{e}.json {a} is the name of the base map, e.g., “ee_field_163” {b} is the number of additional holes put through the map by the method described in later sections {c} is the angle of the lawnmower path {d} is the width of the lawnmower {e} is the number of areas after the division (method described in later sections) For example, the instance “ee_field_163.holes_1_angle_72.0_width_1.0_areas_26.json” is the instance where the base map “ee_field_163” had 1 additional hole added, and there are 26 areas constructed with a lawnmower of width 1.0 going under the angle of 72 degrees. The wkt folder contains the 350 .wkt files with the base maps (from https://zenodo.org/records/14524735) The kml folder contains the 350 .kml files of the base maps, produced by the wtk_to_kml.m script. The example_plots folder containts 15 .png files that show (graphically) how some of the instances look like. These can be generated either by MATLAB or Python scripts described below. The main scripts for producing the .json instances from the base maps are: main_cli.py: Main file for running the instance-generation algorithm (described in further sections) on a single map. main_batch.py: Parallel implementation of main_cli.py for processing multiple maps. requiretements.txt: Required Python packages for the methods. The scripts folder contains supporting Python scripts, with the most important ones being: computational_thread.py: Division of the method into different threads. graph.py: Module for working with graph structures. node_graph.py: Module for computing visibility graphs. paralel_tracks.py: Module for producing parallel tracks. sub_areas.py: Module for partitioning the area. xmeans.py: Module for computing x-means clustering. plot_instances.py: Simple script for plotting the instances. The scripts_matlab folder contains supporting MATLAB scripts: load_data.m: Function for loading the .json instances and doing pre-processing. plot_instance.m: Function for plotting the instances. show_rand_instance.m: Script for showing a random instance. wkt_to_kml.m: Script for transforming maps from .wkt to the .kml format. wkt_to_kml_add_poly.m: Script for transforming maps from .wkt to the .kml format with additional modification by cutting holes in the maps. kml_structure.mat: Support file for the .kml transformation scripts. The data corresponding to each instance (saved in the .json) has the following structure: objects: Array of 2-dimensional points that describe the main area (the first element of the array) and the “holes” in the main area (the other elements). areas: Array of data that describes the individual areas into which the main area was decomposed. There are four fields that constitute this data: end_points: The coordinates of the end points (corner nodes) of the area. Each area has either 4 or 2 (in the case of the area being a single line) endpoints. node_states: Each endpoint can serve as an entering node for the area and, consequently, will have a corresponding exiting node. This array describes the possible pairs of entering and exiting nodes. paths: The progression of paths followed when using the different endpoints as entering nodes. path_distances: The length of the paths through the area when using the different end points as entering nodes. node_states: Concatenated version of the areas.node_states data (sorted by area number). path_distances: Concatenated version of the areas.path_distances data (sorted by area number). distance_table: Table of distances between areas when using the corresponding endpoints as entering nodes. Additionally, the following data are available after calling the load_data.m function: matrix_indices: Identification of the area the entering end points in node_states, path_distances, etc. belong to. matrix_indices_rev: Same data as in matrix_indices, but in the form of a range of indices for the different areas. areas_nr_pnts: Number of entering points for the different areas (either 2 or 4). areas_distance_min: The minimum distance between the different areas (using the most advantageous combination of entering points). areas_distance_mean: The average distance between the different areas (using all possible combinations of entering points). areas_distance_max: The maximum distance between the different areas (using the worst possible combination of entering points).
本数据集对应论文《草坪地图数据:面向覆盖路径规划问题(Coverage Path Planning Problem)的人工数据集》,包含以下文件结构: ### 主数据文件 1918个.json格式的实例文件存储于instances文件夹中。实例命名规则如下: {a}.holes_{b}_angle_{c}_width_{d}_areas_{e}.json 其中各参数含义为: - {a}:基础地图名称,例如"ee_field_163" - {b}:通过后文所述方法添加至地图的额外孔洞数量 - {c}:割草机路径的规划角度 - {d}:割草机的作业宽度 - {e}:主区域经过划分后的子区域总数(划分方法详见后文) 示例:实例"ee_field_163.holes_1_angle_72.0_width_1.0_areas_26.json"对应的场景为:以基础地图"ee_field_163"为基底,添加1个额外孔洞,使用宽度为1.0的割草机以72度角规划路径,最终划分得到26个子区域。 ### 附属文件夹 1. wkt文件夹:包含350个.wkt格式的基础地图文件(数据来源:https://zenodo.org/records/14524735) 2. kml文件夹:包含350个.kml格式的基础地图文件,由wtk_to_kml.m脚本生成 3. example_plots文件夹:包含15个.png格式的可视化文件,直观展示部分实例的样貌。这些可视化结果可通过后文所述的MATLAB或Python脚本生成。 ### 核心生成脚本 用于从基础地图生成.json格式实例的核心脚本包括: 1. main_cli.py:用于对单张地图运行实例生成算法(详见后续章节)的主文件 2. main_batch.py:main_cli.py的并行实现版本,用于批量处理多张地图 3. requiretements.txt:本方法所需的Python依赖包列表 ### 辅助脚本文件夹 scripts文件夹包含各类辅助Python脚本,其中核心脚本如下: - computational_thread.py:将算法拆分为多线程执行的模块 - graph.py:用于处理图结构的工具模块 - node_graph.py:用于计算可见性图的模块 - paralel_tracks.py:用于生成平行轨迹的模块 - sub_areas.py:用于实现区域划分的模块 - xmeans.py:用于执行x-means聚类的模块 - plot_instances.py:用于可视化实例的简易脚本 scripts_matlab文件夹包含MATLAB辅助脚本: - load_data.m:用于加载.json格式实例并完成预处理的函数 - plot_instance.m:用于可视化实例的函数 - show_rand_instance.m:用于随机展示一个实例的脚本 - wkt_to_kml.m:用于将地图从.wkt格式转换为.kml格式的脚本 - wkt_to_kml_add_poly.m:用于将地图从.wkt格式转换为.kml格式的脚本,支持额外添加孔洞裁剪的修改 - kml_structure.mat:用于.kml转换脚本的辅助文件 ### .json实例内部数据结构 每个.json实例存储的数据结构如下: 1. objects:二维点数组,用于描述主区域(数组首个元素)与主区域内的“孔洞”(数组其余元素) 2. areas:描述主区域分解后各子区域的数组,每个子区域包含四个字段: - end_points:子区域端点(拐角节点)的坐标。若子区域为单条直线,则仅包含2个端点;否则包含4个端点 - node_states:每个端点均可作为子区域的进入节点,对应存在一个退出节点。该数组描述了进入节点与退出节点的所有可能配对组合 - paths:以不同端点作为进入节点时,通过该子区域的路径行进序列 - path_distances:以不同端点作为进入节点时,通过该子区域的路径长度 3. node_states:按区域编号排序后的areas.node_states数据的拼接版本 4. path_distances:按区域编号排序后的areas.path_distances数据的拼接版本 5. distance_table:以对应端点作为进入节点时,各子区域之间的距离表 此外,调用load_data.m函数后可获得以下额外数据: 1. matrix_indices:node_states、path_distances等数据中,进入端点所属子区域的标识 2. matrix_indices_rev:与matrix_indices数据一致,但以各子区域的索引范围形式呈现 3. areas_nr_pnts:各子区域的进入点数量(仅为2或4) 4. areas_distance_min:各子区域间的最小距离(采用最优的进入节点组合) 5. areas_distance_mean:各子区域间的平均距离(采用所有可能的进入节点组合) 6. areas_distance_max:各子区域间的最大距离(采用最差的进入节点组合)



