summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src
diff options
context:
space:
mode:
authorOlivier Lanneluc2013-04-13 01:47:31 +0200
committerNicolas Schodet2013-05-03 23:07:12 +0200
commitd55b8f4e2d683279b2f199df400f85bd3f9c7076 (patch)
treea63931b6d2a0983104dab7c75daaf5a230ef4d5d /digital/io-hub/src
parent46d5a660b52b586fb1115c66fce2e248216cd5dc (diff)
digital/io-hub/src/common-cc: add points to all obstacles
Diffstat (limited to 'digital/io-hub/src')
-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. */