From 064579233c9af8d1df2ac8324ec271d2a73db422 Mon Sep 17 00:00:00 2001 From: "Penn, John M 047828115" Date: Mon, 27 Jul 2020 18:01:16 -0500 Subject: [PATCH] Clarity tweak. ref #1011 --- trick_sims/SIM_wheelbot/models/Guidance/src/findpath.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trick_sims/SIM_wheelbot/models/Guidance/src/findpath.cpp b/trick_sims/SIM_wheelbot/models/Guidance/src/findpath.cpp index bf524bb6..eda33e24 100644 --- a/trick_sims/SIM_wheelbot/models/Guidance/src/findpath.cpp +++ b/trick_sims/SIM_wheelbot/models/Guidance/src/findpath.cpp @@ -9,6 +9,7 @@ std::vector FindPath( GridSquare* origin, GridSquare* goal, Arena* arena) std::vector closedSet; std::vector failure; + int estimated_cost_to_goal; // h(n) if (arena == (Arena*)0) { return failure; @@ -25,9 +26,9 @@ std::vector FindPath( GridSquare* origin, GridSquare* goal, Arena* arena) origin->parent = (GridSquare*)0; origin->g_score = 0; - int f_score; - arena->movementCostEstimate(origin, goal, f_score); - origin->f_score = f_score; + + arena->movementCostEstimate(origin, goal, estimated_cost_to_goal); + origin->f_score = estimated_cost_to_goal; openSet.push_back(origin); @@ -94,7 +95,6 @@ std::vector FindPath( GridSquare* origin, GridSquare* goal, Arena* arena) neighbor->parent = current; neighbor->g_score = neighbor_g_score; - int estimated_cost_to_goal; arena->movementCostEstimate(neighbor, goal, estimated_cost_to_goal ); neighbor->f_score = neighbor->g_score + estimated_cost_to_goal;