summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Lanneluc2013-04-13 01:47:31 +0200
committerNicolas Schodet2013-04-27 00:18:23 +0200
commit9dee862008b43919c90f5ebe5b95bc307bd1600f (patch)
tree36584bac873df2f99f51599c91ea96c535d5629b
parente29194cf2afec5d37583804d21c8049c6ab91b44 (diff)
Add points to all obstacles
-rw-r--r--digital/io-hub/src/common-cc/path.cc4
-rw-r--r--digital/io-hub/src/common-cc/path.hh6
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. */