6 double max_mass=-1, max_volu=-1, max_capi=-1;
7 double distance_loss_factor_per_league;
10 #define CTR(x) int ctr_##x;
14 static PotentialResult ****results;
15 /* results[start_isle_ix][finalisle][midisle]-> */
17 int main(int argc, const char **argv) {
21 debug_flags= ~( dbg_sql2 );
23 sysassert( !setvbuf(debug,0,_IOLBF,0) );
27 if (arg[0] != '-') break;
29 if (!strcmp(arg,"-DN")) {
38 max_mass= atof(*argv++);
39 max_volu= atof(*argv++);
40 max_capi= atof(*argv++);
41 double loss_per_league= atof(*argv++);
43 if (!loss_per_league) loss_per_league= 1e-7;
44 distance_loss_factor_per_league= 1.0 - loss_per_league;
50 fprintf(stderr,"setup complete, starting search\n");
53 if (!strcmp(arg,"specific")) {
55 while ((arg= *argv++))
58 double val= value_route(ni, ia, 0);
59 printf("route value is %g\n", val);
60 } else if (!strcmp(arg,"search")) {
61 results= mcalloc(sizeof(*results)*argc);
62 max_dist= atoi(*argv++);
64 while ((arg= *argv++)) {
65 search(atoi(arg), &results[resultsix]);
69 int i, midisle, finisle;
70 for (i=0; i<resultsix; i++) {
71 fprintf(stderr,"================== start #%d ==================\n",i);
72 PotentialResult ***strat_resultsix= results[i];
73 if (!strat_resultsix) continue;
75 for (midisle=0; midisle<islandtablesz; midisle++) {
76 fprintf(stderr,"|mi%-3d",midisle);
79 for (finisle=0; finisle<islandtablesz; finisle++) {
80 PotentialResult **strat_finisle= strat_resultsix[finisle];
81 if (!strat_finisle) continue;
82 fprintf(stderr,"f%-3d",finisle);
83 for (midisle=0; midisle<islandtablesz; midisle++) {
84 PotentialResult *result= strat_finisle[midisle];
88 if (result->absolute < 1000) fprintf(stderr,"| <");
89 else fprintf(stderr,"|%2d",(int)(result->absolute / 1000));
91 if (result->perleague < 100) fprintf(stderr," <");
92 else fprintf(stderr,"%2d",(int)(result->perleague / 100));
102 #define CTR(x) fprintf(stderr," %-30s %10d\n",#x,ctr_##x);