Improve Templates name and readme

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
2024-06-21 21:28:11 +02:00
parent 9a3c3cdd04
commit f10202da96
3 changed files with 83 additions and 69 deletions

View File

@ -18,7 +18,7 @@ static void DoSetup([[maybe_unused]] const benchmark::State& state) {}
static void DoTeardown([[maybe_unused]] const benchmark::State& state) {}
template <IntegerType T>
template <IntegerType CoordinateType>
static void astar_bench(benchmark::State& state) {
auto range = state.range(0);
@ -47,7 +47,7 @@ static void astar_bench(benchmark::State& state) {
std::vector<uint8_t> blocks = std::vector<uint8_t>(mapWidth * mapHeight, 0);
benchmark::DoNotOptimize(blocks);
AStar::AStar<T, false> pathFinder;
AStar::AStar<CoordinateType, false> pathFinder;
benchmark::DoNotOptimize(pathFinder);
pathFinder.setWorldSize({mapWidth, mapHeight});
pathFinder.setHeuristic(AStar::Heuristic::euclidean);
@ -104,7 +104,7 @@ BENCHMARK(astar_bench<uint32_t>)
->UseRealTime()
->Repetitions(repetitions);
template <IntegerType T>
template <IntegerType CoordinateType>
static void astar_bench_fast(benchmark::State& state) {
auto range = state.range(0);
@ -133,7 +133,7 @@ static void astar_bench_fast(benchmark::State& state) {
std::vector<uint32_t> blocks = std::vector<uint32_t>(mapWidth * mapHeight, 0);
benchmark::DoNotOptimize(blocks);
AStar::AStarFast<T, false, uint32_t> pathFinder;
AStar::AStarFast<CoordinateType, false, uint32_t> pathFinder;
benchmark::DoNotOptimize(pathFinder);
pathFinder.setHeuristic(AStar::Heuristic::euclidean);
pathFinder.setDiagonalMovement(true);