From 33d683248b382d264e28669d6a9751b2e9a7bcd2 Mon Sep 17 00:00:00 2001 From: David Miller Date: Sat, 16 Jul 2022 14:04:41 -0700 Subject: [PATCH] Fix error in getSignalDensityAlongAxis(). Fixes #84. --- src/getSensor.cpp | 2 +- tests/configs/testapp.ini | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/getSensor.cpp b/src/getSensor.cpp index b92068d..b74f34c 100644 --- a/src/getSensor.cpp +++ b/src/getSensor.cpp @@ -129,7 +129,7 @@ float getSignalDensityAlongAxis(unsigned layerNum, Coord loc, Dir dir) if (tloc != loc) { Coord offset = tloc - loc; double proj = (dirVecX * offset.x + dirVecY * offset.y); // Magnitude of projection along dir - double contrib = (proj * signals.getMagnitude(layerNum, loc)) / + double contrib = (proj * signals.getMagnitude(layerNum, tloc)) / (offset.x * offset.x + offset.y * offset.y); sum += contrib; } diff --git a/tests/configs/testapp.ini b/tests/configs/testapp.ini index d234092..370b62a 100644 --- a/tests/configs/testapp.ini +++ b/tests/configs/testapp.ini @@ -86,10 +86,10 @@ param-displaysamplegenomes = 1 param-genomeanalysisstride = 1000 param-deterministic = true result-generations = 1000 -result-survivors-min = 280 -result-survivors-max = 280 -result-diversity-min = 0.056 -result-diversity-max = 0.057 +result-survivors-min = 251 +result-survivors-max = 251 +result-diversity-min = 0.080 +result-diversity-max = 0.081 result-genomesize = 8 result-kills = 0