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 f02ffc0a4e6fc440592466d37f9405afd69ca133..f086e57d29c23ca45ea34e89fd00de1461e99552 100644 (file)
@@ -21,6 +21,8 @@ extern FILE *debug_file;
 #define DEBUG_DEV "/dev/stdout" /* just for glpk */
 
 
 #define DEBUG_DEV "/dev/stdout" /* just for glpk */
 
 
+#define GRANUS 3
+
 #define COUNTER_LIST                           \
    CTR(commodities_loaded)                     \
    CTR(trades_loaded)                          \
 #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)                      \
    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)
    CTR(subroute_tails_valued)                  \
    CTR(subroutes_valued)                       \
    CTR(subroutes_nonempty)
@@ -121,8 +123,6 @@ typedef struct {
   int ports[AP][MAX_ROUTELEN];
 } PotentialResult;
 
   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]
 void setup_search(void);
 void search(int start_isle, int final_isle /* -1 means any */,
            PotentialResult ****buckets_base_io[GRANUS]
index 5ad6136180fa528ab220c06b8c74ad78771954af..74a2f4504feb0840444a3da69cbd166333010aa5 100644 (file)
@@ -149,7 +149,7 @@ static double process_route(int nports, int totaldist,
        debugf("      ");
       } else {
        int pos;
        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;
        bucket->value[ap]= value[ap];
        memcpy(bucket->ports[ap], ports, sizeof(*ports) * nports);
        if (nports < MAX_ROUTELEN-1) bucket->ports[ap][nports]= -1;