chiark / gitweb /
WIP routesearch; stratify results by significant bits of route
[ypp-sc-tools.main.git] / yarrg / rscommon.h
index 7c70ca4..873ff30 100644 (file)
@@ -8,6 +8,7 @@
    DF(sql2)                                    \
    DF(value)                                   \
    DF(search)                                  \
+   DF(filter)                                  \
    DF(check)                                   \
    DF(lp)
 
@@ -100,8 +101,14 @@ IslandPair *ipair_get_maybe(int si, int di);
 double value_route(int nislands, const int *islands, int exclude_arbitrage);
 void setup_value(void);
 
+typedef struct {
+  double absolute, perleague;
+  int absolute_ports[MAX_ROUTELEN], perleague_ports[MAX_ROUTELEN];
+} PotentialResult;
+
 void setup_search(void);
-void search(int start_isle);
+void search(int start_isle, PotentialResult ****strat_base_io
+                                /* strat_base[finalisle][midisle]-> */);
 
 extern double max_mass, max_volu, max_capi;
 extern double distance_loss_factor_per_league;
@@ -112,4 +119,9 @@ extern int max_dist;
 extern int islandtablesz;
 
 
+#define ONDEMAND(pointer_lvalue, calloc_size_count)                         \
+  ((pointer_lvalue) ? :                                                             \
+   ((pointer_lvalue) = mcalloc(sizeof(*(pointer_lvalue)) * calloc_size_count)))
+
+
 #endif /*RSCOMMON_H*/