Skip to content

Commit

Permalink
Fix error in getSignalDensityAlongAxis(). Fixes #84.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrmiller committed Jul 16, 2022
1 parent 8ae6478 commit 33d6832
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/getSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/configs/testapp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 33d6832

Please sign in to comment.