From db9532ae255798454be991a1d8cdd1bc55206363 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 7 Oct 2023 03:23:49 +0200 Subject: a --- src/path-search-astar.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/path-search-astar.hpp') diff --git a/src/path-search-astar.hpp b/src/path-search-astar.hpp index 9da51d24..bb3089b2 100644 --- a/src/path-search-astar.hpp +++ b/src/path-search-astar.hpp @@ -2,8 +2,8 @@ #include "compat/defs.hpp" #include "global-coords.hpp" #include - #include +#include namespace floormat { @@ -30,9 +30,6 @@ struct astar_edge int8_t from_offx, from_offy, to_offx, to_offy; static constexpr auto INF = (uint32_t)-1; - -private: - astar_edge(); }; struct astar_edge_tuple @@ -46,19 +43,24 @@ struct astar_edge_tuple struct astar final { - void reserve(size_t count); - bool empty() const { return Q.empty(); } + astar(); [[nodiscard]] bool add_visited(const astar_edge& value); void push(const astar_edge& value, uint32_t dist); astar_edge_tuple pop(); + + bool empty() const { return Q.empty(); } + void reserve(size_t count); void clear(); private: + struct edge_min { astar_edge prev; uint32_t len; }; + static constexpr bool StoreHash = true; // todo benchmark it tsl::robin_set, std::allocator, StoreHash> seen; + tsl::robin_map mins; std::vector Q; }; -- cgit v1.2.3