From 9dee862008b43919c90f5ebe5b95bc307bd1600f Mon Sep 17 00:00:00 2001 From: Olivier Lanneluc Date: Sat, 13 Apr 2013 01:47:31 +0200 Subject: Add points to all obstacles --- digital/io-hub/src/common-cc/path.cc | 4 ++-- digital/io-hub/src/common-cc/path.hh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/digital/io-hub/src/common-cc/path.cc b/digital/io-hub/src/common-cc/path.cc index f6b58f63..01a6821d 100644 --- a/digital/io-hub/src/common-cc/path.cc +++ b/digital/io-hub/src/common-cc/path.cc @@ -279,12 +279,12 @@ void Path::prepare_score(const vect_t &src, int factor) { DPRINTF("Path prepare score from src=(%u;%u) factor=%u\n", src.x, src.y, factor); escape_factor = factor; - astar_dijkstra_prepare(astar_nodes, PATH_POINTS_NB, /*PATH_POINT_SRC_IDX*/get_point_index(src), PATH_POINT_DST_IDX); + astar_dijkstra_prepare(astar_nodes, PATH_POINTS_NB, get_point_index(src), PATH_POINT_DST_IDX); } uint16_t Path::get_score(const vect_t &dst) { - uint16_t score = astar_dijkstra_finish(astar_nodes, PATH_POINTS_NB, /*PATH_POINT_DST_IDX*/get_point_index(dst)); + uint16_t score = astar_dijkstra_finish(astar_nodes, PATH_POINTS_NB, get_point_index(dst)); DPRINTF("Path get score=%u for dst=(%u;%u)\n", score, dst.x, dst.y); return score; } diff --git a/digital/io-hub/src/common-cc/path.hh b/digital/io-hub/src/common-cc/path.hh index f49188fa..36fde87e 100644 --- a/digital/io-hub/src/common-cc/path.hh +++ b/digital/io-hub/src/common-cc/path.hh @@ -94,10 +94,10 @@ class Path private: /** Number of possible obstacles. */ static const uint8_t PATH_OBSTACLES_NB = (4+1/*cake*/); - /** Number of points for the cake */ - static const uint8_t PATH_CAKE_POINTS_NB = 10; /** Number of points per standard obstacle. */ - static const uint8_t PATH_OBSTACLES_POINTS_NB = 6; + static const uint8_t PATH_OBSTACLES_POINTS_NB = 8; + /** Number of points for the cake */ + static const uint8_t PATH_CAKE_POINTS_NB = 12; /** Number of reserved points for the 2 endpoints */ static const uint8_t PATH_RESERVED_POINTS_NB = 2; /** Number of points. */ -- cgit v1.2.3