chiark / gitweb /
routesearch: rework some things, bugfixes
[ypp-sc-tools.db-test.git] / yarrg / rsvalue.c
index 8fe5f229b04b00355817b7225475a9068e8d9621..22b3d2988f89c857196509f83b14678df629073d 100644 (file)
@@ -5,6 +5,7 @@
 #include "rscommon.h"
 
 DEBUG_DEFINE_DEBUGF(value);
+DEBUG_DEFINE_SOME_DEBUGF(value2,debug2f);
 
 typedef struct { int mass, volu; } CommodInfo;
 static int commodstabsz;
@@ -148,7 +149,7 @@ static IslandPair *ipair_get_create(int si, int di) {
   if (si==di) ctr_islands_arbitrage++;
   else ctr_ipairs_relevant++;
 
-  debugf("VALUE ipair_get(i%d,i%d) running...\n", si,di);
+  debug2f("VALUE ipair_get(i%d,i%d) running...\n", si,di);
   SQL_MUST( sqlite3_bind_int(ss_ipair_dist, 1, si) );
   SQL_MUST( sqlite3_bind_int(ss_ipair_dist, 2, di) );
   assert(SQL_STEP(ss_ipair_dist));
@@ -314,6 +315,9 @@ double value_route(int nislands, const int *islands, int exclude_arbitrage) {
   lpx_delete_prob(lp);
   lp= 0;
 
+  debugf("    %s %f\n",
+        exclude_arbitrage ? "base value" : "route value",
+        profit);
   return profit;
 }