1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

tools/zep_dispatch: topogen: fix distance calculation

This commit is contained in:
Benjamin Valentin 2023-10-04 16:30:43 +02:00
parent 1c15624384
commit 875bf98280

View File

@ -70,7 +70,7 @@ static double node_distance(const struct node *a, const struct node *b)
static double node_distance_weight(const struct node *a, const struct node *b) static double node_distance_weight(const struct node *a, const struct node *b)
{ {
double w = 1 - node_distance(a, b) / a->r; double w = 1 - pow(node_distance(a, b), 2) / pow(a->r, 2);
if (w < 0) { if (w < 0) {
return 0; return 0;