From 0c541c7a14158024aeb55a2f2247ed5894fa90f4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 24 Oct 2023 15:55:36 +0200 Subject: [PATCH] Changed weight factors for search wire --- CaSSAndRA/app.py | 2 +- CaSSAndRA/src/backend/data/appdata.py | 2 +- CaSSAndRA/src/backend/data/mapdata.py | 2 +- CaSSAndRA/src/backend/map/pathfinder.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CaSSAndRA/app.py b/CaSSAndRA/app.py index 2c728a2..1617a05 100755 --- a/CaSSAndRA/app.py +++ b/CaSSAndRA/app.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -#Version:0.95.2 Fixed max_date_allowed in date picker +#Version:0.95.3 Changed some weigh factors for search wire # package imports import os import sys diff --git a/CaSSAndRA/src/backend/data/appdata.py b/CaSSAndRA/src/backend/data/appdata.py index 12e32d8..86a6f9a 100644 --- a/CaSSAndRA/src/backend/data/appdata.py +++ b/CaSSAndRA/src/backend/data/appdata.py @@ -1,4 +1,4 @@ import logging logger = logging.getLogger(__name__) -version = '0.95.2' \ No newline at end of file +version = '0.95.3' \ No newline at end of file diff --git a/CaSSAndRA/src/backend/data/mapdata.py b/CaSSAndRA/src/backend/data/mapdata.py index da95eea..4dd2a8b 100644 --- a/CaSSAndRA/src/backend/data/mapdata.py +++ b/CaSSAndRA/src/backend/data/mapdata.py @@ -193,7 +193,7 @@ def create_networkx_graph(self): possible_way = self.check_direct_way(search_wire_coords[i], list(perimeter_point.coords)[0]) if possible_way: direct_way = LineString((search_wire_coords[i], list(perimeter_point.coords)[0])) - G.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2) + G.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length) logger.debug('NetworkX perimeter + exclusion + perimeter/exclusion edges + search wire edges: '+str(len(G.edges))) else: logger.info('No search wire found.') diff --git a/CaSSAndRA/src/backend/map/pathfinder.py b/CaSSAndRA/src/backend/map/pathfinder.py index 13a8763..6147393 100644 --- a/CaSSAndRA/src/backend/map/pathfinder.py +++ b/CaSSAndRA/src/backend/map/pathfinder.py @@ -54,14 +54,14 @@ def add_edges(self, point: Point) -> None: nearest_point = nearest_points(point, self.search_wire)[1] if self.check_direct_way(list(point.coords)[0], list(nearest_point.coords)[0]): direct_way = LineString((list(point.coords)[0], list(nearest_point.coords)[0])) - self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2) + self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length) for possible_point in self.search_wire_points.geoms: if self.check_direct_way(list(point.coords)[0], list(possible_point.coords)[0]): direct_way = LineString((list(point.coords)[0], list(possible_point.coords)[0])) - self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2) + self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length) if self.check_direct_way(list(nearest_point.coords)[0], list(possible_point.coords)[0]): direct_way = LineString((list(nearest_point.coords)[0], list(possible_point.coords)[0])) - self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2) + self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length) def find_way(self, start: list(), goal: list()) -> list: start = affinity.rotate(Point(start), self.angle, origin=(0, 0))