From 34e6eb95b537c9657299da15b885ea9c8f04acaa Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 24 Jul 2024 23:46:42 +0200 Subject: [PATCH] Add constructor to set PriorityWeights for inital search --- astar/Astar.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astar/Astar.cs b/astar/Astar.cs index 94627a9..f838f56 100644 --- a/astar/Astar.cs +++ b/astar/Astar.cs @@ -6,11 +6,11 @@ using OSM_Regions; namespace astar { - public class Astar(ValueTuple? optimizingWeights = null, int? explorationDistance = null, int? explorationMultiplier = null) + public class Astar(ValueTuple? priorityWeights = null, ValueTuple? optimizingWeights = null, int? explorationDistance = null, int? explorationMultiplier = null) { - private static readonly ValueTuple DefaultPriorityWeights = new(1, 1.4f, 0, 0); + private readonly ValueTuple DefaultPriorityWeights = priorityWeights ?? new(1, 1.4f, 0, 0); private readonly ValueTuple OptimizingWeights = optimizingWeights ?? new(0, 0.07f, 0, 0); - private int ExplorationDistanceFromRoute = explorationDistance ?? 200; + private int ExplorationDistanceFromRoute = explorationDistance ?? 1200; private int ExplorationMultiplier = explorationMultiplier ?? 65; public Route FindPath(float startLat, float startLon, float endLat, float endLon, float regionSize, bool car = true, PathMeasure pathing = PathMeasure.Distance, float additionalExploration = 3, string? importFolderPath = null, ILogger? logger = null)