chiark / gitweb /
WIP routesearch; route tail guesswork pruning optimisation
[ypp-sc-tools.db-live.git] / yarrg / rscommon.h
index d068fa02ba25a040eae556ebb3b278519f67a76e..f62fd99d9ed15cdf4d9cd873a6406c3d7a60d38b 100644 (file)
@@ -7,8 +7,12 @@
    DF(sql)                                     \
    DF(sql2)                                    \
    DF(value)                                   \
+   DF(search)                                  \
+   DF(check)                                   \
    DF(lp)
+
 #define debug stdout
+#define DEBUG_DEV "/dev/stdout"
 
 #include "common.h"
 
@@ -43,14 +47,31 @@ void sql_bind(sqlite3_stmt *ss, int index, int value,
 
 extern sqlite3 *db;
 
-void setup(void);
-double value_route(int nislands, const int *islands);
+void setup_sql(void);
+
+
+typedef struct {
+  double distance_loss_factor;
+  int ntrades;
+  struct TradesBlock *trades;
+  double route_tail_value;
+} IslandPair;
+
+IslandPair *ipair_get(int si, int di);
+
+double value_route(int nislands, const int *islands, int exclude_arbitrage);
 void setup_value(void);
-void setup_commods(void);
+
+void setup_search(void);
+void search(int start_isle);
 
 extern double max_mass, max_volu, max_capi;
 extern double distance_loss_factor_per_league;
+extern int max_dist;
 
 #define LOSS_FACTOR_PER_DELAY_SLOT (1-1e-8)
 
+extern int islandtablesz;
+
+
 #endif /*RSCOMMON_H*/