From 875bf98280a394d6e090b5cb39dd5cbd2fe0932f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 4 Oct 2023 16:30:43 +0200 Subject: [PATCH] tools/zep_dispatch: topogen: fix distance calculation --- dist/tools/zep_dispatch/topogen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/tools/zep_dispatch/topogen.c b/dist/tools/zep_dispatch/topogen.c index 5e4a8c130f..6a22c45256 100644 --- a/dist/tools/zep_dispatch/topogen.c +++ b/dist/tools/zep_dispatch/topogen.c @@ -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) { - 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) { return 0;