#include "rscommon.h"
+int o_quiet= 0;
+double max_mass=-1, max_volu=-1, max_capi=-1;
+double distance_loss_factor_per_league;
+int max_dist= -1;
+
int main(int argc, const char **argv) {
- int ia[argc], ni=0;
const char *arg;
- while ((arg= *++argv)) {
- ia[ni++]= atoi(arg);
+
+#ifndef debug_flags
+ debug_flags= ~( dbg_sql2 );
+#endif
+ sysassert( !setvbuf(debug,0,_IOLBF,0) );
+
+ for (;;) {
+ arg= *++argv;
+ if (arg[0] != '-') break;
+#ifndef debug_flags
+ if (!strcmp(arg,"-DN")) {
+ debug_flags= 0;
+ } else
+#endif
+ {
+ abort();
+ }
+ }
+
+ max_mass= atof(*argv++);
+ max_volu= atof(*argv++);
+ max_capi= atof(*argv++);
+ double loss_per_league= atof(*argv++);
+
+ if (!loss_per_league) loss_per_league= 1e-7;
+ distance_loss_factor_per_league= 1.0 - loss_per_league;
+
+ setup_sql();
+ setup_value();
+ setup_search();
+
+ arg= *argv++;
+ if (!strcmp(arg,"specific")) {
+ int ia[argc], ni=0;
+ while ((arg= *argv++))
+ ia[ni++]= atoi(arg);
+
+ double val= value_route(ni, ia, 0);
+ printf("route value is %g\n", val);
+ } else if (!strcmp(arg,"search")) {
+ max_dist= atoi(*argv++);
+ while ((arg= *argv++))
+ search(atoi(arg));
+ } else {
+ abort();
}
- value_route(ni, ia);
return 0;
}