From 8507bec1bc4a359efa462ffac2d3e7fb8adbe32d Mon Sep 17 00:00:00 2001 From: Simon O'Shea Date: Tue, 8 Aug 2023 19:27:43 -0400 Subject: still trying to fix astar --- Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs') diff --git a/Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs b/Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs index a3fe8e0..212d6d2 100644 --- a/Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs +++ b/Pathfinding Visualizer/Assets/Scripts/Pathfinder.cs @@ -67,6 +67,7 @@ public class Pathfinder for(int i = 0; i < result.Count; i++) { Node n = result[i]; + Debug.Log("Agent at: " + n.agent.x + ", " + n.agent.y); Debug.Log(n.lastMove); } } @@ -79,9 +80,6 @@ public class Pathfinder List open = new List(); - - //PriorityQueue open = new PriorityQueue(); - open.Add(initialState); int cap = 1000; while (true && cap > 0) @@ -100,7 +98,6 @@ public class Pathfinder { while (currentNode.parent != null) { - Debug.Log("Agent at: " + currentNode.agent.x + ", " + currentNode.agent.y); solution.Add(currentNode); currentNode = currentNode.parent; } @@ -139,7 +136,7 @@ public class Pathfinder sorted.Add(children[i]); } - sorted = sorted.OrderBy(Node => Node.fn).ToList(); + //sorted = sorted.OrderBy(Node => Node.fn).ToList(); return sorted; } -- cgit v1.3.1-4-g156e