diff options
Diffstat (limited to 'src/cadet/desirability_table.c')
-rw-r--r-- | src/cadet/desirability_table.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/cadet/desirability_table.c b/src/cadet/desirability_table.c index 5c23de76b..829c618af 100644 --- a/src/cadet/desirability_table.c +++ b/src/cadet/desirability_table.c | |||
@@ -8,26 +8,26 @@ | |||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | 9 | ||
10 | int | 10 | int |
11 | main() | 11 | main () |
12 | { | 12 | { |
13 | for (unsigned int num_alts = 1; num_alts < 10; num_alts++) | 13 | for (unsigned int num_alts = 1; num_alts < 10; num_alts++) |
14 | for (unsigned int off = 0; off < 10; off++) | 14 | for (unsigned int off = 0; off < 10; off++) |
15 | for (double delta = -(int)off; delta <= 5; delta += 0.25) | 15 | for (double delta = -(int) off; delta <= 5; delta += 0.25) |
16 | { | 16 | { |
17 | double weight_alts; | 17 | double weight_alts; |
18 | 18 | ||
19 | if (delta <= -1.0) | 19 | if (delta <= -1.0) |
20 | weight_alts = -1.0 * num_alts / delta; /* discount alternative paths */ | 20 | weight_alts = -1.0 * num_alts / delta; /* discount alternative paths */ |
21 | else if (delta >= 1.0) | 21 | else if (delta >= 1.0) |
22 | weight_alts = 1.0 * num_alts * delta; /* overcount alternative paths */ | 22 | weight_alts = 1.0 * num_alts * delta; /* overcount alternative paths */ |
23 | else | 23 | else |
24 | weight_alts = 1.0 * num_alts; /* count alternative paths normally */ | 24 | weight_alts = 1.0 * num_alts; /* count alternative paths normally */ |
25 | 25 | ||
26 | fprintf(stderr, | 26 | fprintf (stderr, |
27 | "Paths: %u Offset: %u Delta: %5.2f SCORE: %f\n", | 27 | "Paths: %u Offset: %u Delta: %5.2f SCORE: %f\n", |
28 | num_alts, | 28 | num_alts, |
29 | off, | 29 | off, |
30 | delta, | 30 | delta, |
31 | ((off + 1.0) / (weight_alts * weight_alts))); | 31 | ((off + 1.0) / (weight_alts * weight_alts))); |
32 | } | 32 | } |
33 | } | 33 | } |