chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP routesearch; better debugging output
[ypp-sc-tools.db-live.git]
/
yarrg
/
rssearch.c
diff --git
a/yarrg/rssearch.c
b/yarrg/rssearch.c
index eb5e9583a3ef92c4c8e02a0fc30b2bd739d625b9..f14b0cd7a87670e6785d6a34bcc2d0adca4e3a22 100644
(file)
--- a/
yarrg/rssearch.c
+++ b/
yarrg/rssearch.c
@@
-2,6
+2,8
@@
#include "rscommon.h"
#include "rscommon.h"
+DEBUG_DEFINE_DEBUGF(search);
+
typedef struct Neighbour {
struct Neighbour *next;
int islandid;
typedef struct Neighbour {
struct Neighbour *next;
int islandid;
@@
-35,6
+37,13
@@
static Neighbour *get_neighbours(int isle) {
static double best_absolute, best_perleague;
static void process_route(int nports, int totaldist) {
static double best_absolute, best_perleague;
static void process_route(int nports, int totaldist) {
+ int i;
+
+ debugf("========== ROUTE");
+ for (i=0; i<nports; i++)
+ debugf(" %d",ports[i]);
+ debugf("\n");
+
double absolute= value_route(nports, ports);
double perleague= absolute / (totaldist + nports);
double absolute= value_route(nports, ports);
double perleague= absolute / (totaldist + nports);
@@
-50,7
+59,6
@@
static void process_route(int nports, int totaldist) {
fputs(" route",stderr);
fputs(" route",stderr);
- int i;
for (i=0; i<nports; i++)
fprintf(stderr," %d",ports[i]);
putc('\n',stderr);
for (i=0; i<nports; i++)
fprintf(stderr," %d",ports[i]);
putc('\n',stderr);