mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tools/zep_dispatch: topogen: fix distance calculation
This commit is contained in:
parent
1c15624384
commit
875bf98280
2
dist/tools/zep_dispatch/topogen.c
vendored
2
dist/tools/zep_dispatch/topogen.c
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user