Skip to content

Commit

Permalink
Use score instead of gpt for shorten
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Apr 19, 2015
1 parent 9110082 commit a4dfadc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,17 +1234,16 @@ def routeStillHasAChance(r):
route for route in routes if routePickPred(route)
)

if cmdenv.loop:
if cmdenv.loop or cmdenv.shorten:
cmdenv.DEBUG0("Using {} picked routes", len(pickedRoutes))
routes = pickedRoutes
# normalise the scores for fairness...
for route in routes:
cmdenv.DEBUG0(
"{} hops, {} score, {} gpt",
len(route.hops), route.score, route.gpt
)
route.score /= len(route.hops)
elif cmdenv.shorten:
cmdenv.DEBUG0("Picking from {} shortened routes", len(pickedRoutes))
routes = pickedRoutes
for route in routes:
cmdenv.DEBUG0("{} hops / {} gpt", len(route.hops), route.gpt)
route.score = route.gpt

if not routes:
raise NoDataError(
Expand Down

0 comments on commit a4dfadc

Please sign in to comment.