Skip to content

Commit

Permalink
Fix for avoiding stations not working
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Sep 1, 2014
1 parent 1251d01 commit f5383ab
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ def getDestinations(self, maxJumps=None, maxLyPer=None, avoiding=None):

openList = [ Node(self.system, [], 0) ]
pathList = { system.ID: Node(system, None, 0.0)
# include avoids so we only have
# to consult one place for exclusions
# include avoids so we only have
# to consult one place for exclusions
for system in avoiding + [ self ]
# the avoid list may contain stations,
# which affects destinations but not vias
# the avoid list may contain stations,
# which affects destinations but not vias
if isinstance(system, System) }

# As long as the open list is not empty, keep iterating.
Expand Down Expand Up @@ -197,7 +197,8 @@ def getDestinations(self, maxJumps=None, maxLyPer=None, avoiding=None):
for node in pathList.values():
if node.distLy > epsilon: # Values indistinguishable from zero are avoidances
for station in node.system.stations:
destStations += [ Destination(node.system, station, [self.system] + node.via + [station.system], node.distLy) ]
if not station in avoidStations:
destStations += [ Destination(node.system, station, [self.system] + node.via + [station.system], node.distLy) ]

return destStations

Expand Down

0 comments on commit f5383ab

Please sign in to comment.