chiark / gitweb /
routesearch: give tableau its own debug flag
[ypp-sc-tools.main.git] / yarrg / rscommon.h
index 0933e0fecc9565b2368ebb0d3f4b55284aff5f6b..5da0721dbec588b8d004e7d2c2f4110de01c238e 100644 (file)
    DF(search)                                  \
    DF(filter)                                  \
    DF(check)                                   \
+   DF(tableau)                                 \
    DF(lp)
 
-#define debug stdout
-#define DEBUG_DEV "/dev/stdout"
+#define debug debug_file
 
 #include "common.h"
 
+extern FILE *debug_file;
+#define DEBUG_DEV "/dev/stdout" /* just for glpk */
+
 
 #define COUNTER_LIST                           \
    CTR(commodities_loaded)                     \
    CTR(ipairs_relevant)                                \
    CTR(quantities_loaded)                      \
    CTR(routes_considered)                      \
+   CTR(routes_wrongfinalelim)                  \
    CTR(routes_quickelim)                       \
    CTR(routes_stratelim)                       \
    CTR(routes_valued)                          \
+   CTR(routes_wrongfinal)                      \
    CTR(newbests_strat_absolute)                        \
-   CTR(newbests_strat_perleague)                       \
+   CTR(newbests_strat_perleague)               \
    CTR(subroute_tails_valued)                  \
    CTR(subroutes_valued)                       \
    CTR(subroutes_nonempty)
@@ -42,9 +47,9 @@
      * chk1 and chk2 are blocks using sqe and  int sqr; */              \
     const char *sql_must_call_string= #call;                            \
     int sqr;                                                            \
-    if (DEBUGP(sql2)) fprintf(stderr,"SQL %s", sql_must_call_string);   \
+    if (DEBUGP(sql2)) fprintf(debug,"SQL %s", sql_must_call_string);    \
     sqr= (call);                                                        \
-    if (DEBUGP(sql2)) fprintf(stderr," = %d\n", sqr);                   \
+    if (DEBUGP(sql2)) fprintf(debug," = %d\n", sqr);                    \
     if (sqr) sql_fatal("(unknown)", sqr, sql_must_call_string);                 \
   })                                                                    \
 
@@ -112,8 +117,9 @@ typedef struct {
 } PotentialResult;
 
 void setup_search(void);
-void search(int start_isle, PotentialResult ****strat_base_io
-                                /* strat_base[finalarch][midarch]-> */);
+void search(int start_isle, int final_isle /* -1 means any */,
+           PotentialResult ****strat_base_io
+               /* strat_base[finalarch][midarch]-> */);
 
 extern double max_mass, max_volu, max_capi;
 extern double distance_loss_factor_per_league;
@@ -128,6 +134,9 @@ extern char **archnames;
 extern int *islandid2arch;
 
 
+extern FILE *output;
+
+
 #define NEW(ptr) ((ptr)= mmalloc(sizeof(*ptr)))
 
 #define MCALLOC(array, count) ((array)= mcalloc(sizeof(*(array)) * (count)))