chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
routesearch: event counters
[ypp-sc-tools.main.git]
/
yarrg
/
rsmain.c
diff --git
a/yarrg/rsmain.c
b/yarrg/rsmain.c
index 7904c013c1362b622d13017d54ce6ed351e689b1..da05f4780fb30ed0256b684aee3c7cea241f5477 100644
(file)
--- a/
yarrg/rsmain.c
+++ b/
yarrg/rsmain.c
@@
-7,26
+7,31
@@
double max_mass=-1, max_volu=-1, max_capi=-1;
double distance_loss_factor_per_league;
int max_dist= -1;
double distance_loss_factor_per_league;
int max_dist= -1;
+#define CTR(x) int ctr_##x;
+ COUNTER_LIST
+#undef CTR
+
int main(int argc, const char **argv) {
const char *arg;
int main(int argc, const char **argv) {
const char *arg;
+#ifndef debug_flags
debug_flags= ~( dbg_sql2 );
debug_flags= ~( dbg_sql2 );
+#endif
sysassert( !setvbuf(debug,0,_IOLBF,0) );
for (;;) {
arg= *++argv;
if (arg[0] != '-') break;
sysassert( !setvbuf(debug,0,_IOLBF,0) );
for (;;) {
arg= *++argv;
if (arg[0] != '-') break;
+#ifndef debug_flags
if (!strcmp(arg,"-DN")) {
debug_flags= 0;
if (!strcmp(arg,"-DN")) {
debug_flags= 0;
- } else {
+ } else
+#endif
+ {
abort();
}
}
abort();
}
}
- setup_sql();
- setup_value();
- setup_search();
-
max_mass= atof(*argv++);
max_volu= atof(*argv++);
max_capi= atof(*argv++);
max_mass= atof(*argv++);
max_volu= atof(*argv++);
max_capi= atof(*argv++);
@@
-34,6
+39,12
@@
int main(int argc, const char **argv) {
if (!loss_per_league) loss_per_league= 1e-7;
distance_loss_factor_per_league= 1.0 - loss_per_league;
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();
+
+ fprintf(stderr,"setup complete, starting search\n");
arg= *argv++;
if (!strcmp(arg,"specific")) {
arg= *argv++;
if (!strcmp(arg,"specific")) {
@@
-41,7
+52,7
@@
int main(int argc, const char **argv) {
while ((arg= *argv++))
ia[ni++]= atoi(arg);
while ((arg= *argv++))
ia[ni++]= atoi(arg);
- double val= value_route(ni, ia);
+ double val= value_route(ni, ia
, 0
);
printf("route value is %g\n", val);
} else if (!strcmp(arg,"search")) {
max_dist= atoi(*argv++);
printf("route value is %g\n", val);
} else if (!strcmp(arg,"search")) {
max_dist= atoi(*argv++);
@@
-50,5
+61,10
@@
int main(int argc, const char **argv) {
} else {
abort();
}
} else {
abort();
}
+
+#define CTR(x) fprintf(stderr," %-30s %10d\n",#x,ctr_##x);
+ COUNTER_LIST
+#undef CTR
+
return 0;
}
return 0;
}