X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;ds=sidebyside;f=yarrg%2Frscommon.h;h=0933e0fecc9565b2368ebb0d3f4b55284aff5f6b;hb=706d75804688b94f51b806adc44f10269c35b0db;hp=5cbf5b77b0cf84cdce30526713169ecf2cca94a7;hpb=d0f65e91f071ebb0fbc6791ee168e2be5ba8e5ae;p=ypp-sc-tools.db-test.git diff --git a/yarrg/rscommon.h b/yarrg/rscommon.h index 5cbf5b7..0933e0f 100644 --- a/yarrg/rscommon.h +++ b/yarrg/rscommon.h @@ -21,10 +21,15 @@ #define COUNTER_LIST \ CTR(commodities_loaded) \ CTR(trades_loaded) \ + CTR(islands_arbitrage) \ + CTR(ipairs_relevant) \ CTR(quantities_loaded) \ CTR(routes_considered) \ - CTR(routes_eliminated) \ + CTR(routes_quickelim) \ + CTR(routes_stratelim) \ CTR(routes_valued) \ + CTR(newbests_strat_absolute) \ + CTR(newbests_strat_perleague) \ CTR(subroute_tails_valued) \ CTR(subroutes_valued) \ CTR(subroutes_nonempty) @@ -137,9 +142,36 @@ extern int *islandid2arch; }) +typedef struct { + double value; + PotentialResult *pr; +} HighScoreEntry; + +extern int nhighscores_absolute, nhighscores_perleague; +extern HighScoreEntry *highscores_absolute; +extern HighScoreEntry *highscores_perleague; + + #define ONDEMAND(pointer_lvalue, calloc_size_count) \ ((pointer_lvalue) ? : \ ((pointer_lvalue) = mcalloc(sizeof(*(pointer_lvalue)) * calloc_size_count))) +static inline int isle2arch(int isle) { + int arch= islandid2arch[isle]; + assert(arch>=0); + return arch; +} + +static inline int route2midarch(const int *ports, int nports) { + int archs[nports], last_arch=-1, narchs=0, i; + for (i=0; i