chiark / gitweb /
routesearch: debugging newbest counters split by granu too
authorIan Jackson <ian@liberator.(none)>
Wed, 14 Oct 2009 20:22:22 +0000 (21:22 +0100)
committerIan Jackson <ian@liberator.(none)>
Wed, 14 Oct 2009 20:22:22 +0000 (21:22 +0100)
yarrg/rscommon.h
yarrg/rssearch.c

index f02ffc0..f086e57 100644 (file)
@@ -21,6 +21,8 @@ extern FILE *debug_file;
 #define DEBUG_DEV "/dev/stdout" /* just for glpk */
 
 
+#define GRANUS 3
+
 #define COUNTER_LIST                           \
    CTR(commodities_loaded)                     \
    CTR(trades_loaded)                          \
@@ -33,7 +35,7 @@ extern FILE *debug_file;
    CTR(routes_bucketelim)                      \
    CTR(routes_valued)                          \
    CTR(routes_wrongfinal)                      \
-   CTRA(newbests_granu,2)                      \
+   CTRA(newbests_granu,GRANUS*2)               \
    CTR(subroute_tails_valued)                  \
    CTR(subroutes_valued)                       \
    CTR(subroutes_nonempty)
@@ -121,8 +123,6 @@ typedef struct {
   int ports[AP][MAX_ROUTELEN];
 } PotentialResult;
 
-#define GRANUS 3
-
 void setup_search(void);
 void search(int start_isle, int final_isle /* -1 means any */,
            PotentialResult ****buckets_base_io[GRANUS]
index 5ad6136..74a2f45 100644 (file)
@@ -149,7 +149,7 @@ static double process_route(int nports, int totaldist,
        debugf("      ");
       } else {
        int pos;
-       ctr_newbests_granu[ap]++;
+       ctr_newbests_granu[granui*AP+ap]++;
        bucket->value[ap]= value[ap];
        memcpy(bucket->ports[ap], ports, sizeof(*ports) * nports);
        if (nports < MAX_ROUTELEN-1) bucket->ports[ap][nports]= -1;