Skip to content

Commit

Permalink
change limitCalc(accuracy) from string to int option
Browse files Browse the repository at this point in the history
  • Loading branch information
mEDI-S committed Aug 22, 2015
1 parent a456609 commit b1c8dbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions elite/dealsroute.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ def getOption(self, option):
if option in self.options:
return self.options[option]

def limitCalc(self, accuracy="normal"):
def limitCalc(self, accuracy=0):
''' ["normal","fast","nice","slow","all"] '''
maxResults = 100000 # normal

if accuracy == "fast":
if accuracy == 1:
maxResults = 5000
elif accuracy == "nice":
elif accuracy == 2:
maxResults = 1000000
elif accuracy == "slow":
elif accuracy == 3:
maxResults = 4000000

self.options["resultLimit"] = round( maxResults**(1.0 / self.options["tradingHops"] )) #max results = 1000000 = resultLimit^tradingHops

if accuracy == "all":
if accuracy == 4:
self.options["resultLimit"] = 999999

def setMaxAgeDate(self):
Expand Down
3 changes: 2 additions & 1 deletion find_multi_hop_trade_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
route = elite.dealsroute(mydb)

route.setOption( "startSystem", location.getLocation() )

route.setOption( "tradingHops", 2 )
route.setOption( "maxJumpDistance", 16.3 )
route.setOption( "minStock", 10000 )
Expand All @@ -19,7 +20,7 @@

route.calcDefaultOptions()

route.limitCalc("normal") #options (normal, fast, nice, slow, all)
route.limitCalc(0) #options (normal, fast, nice, slow, all)

route.calcRoute()

Expand Down

0 comments on commit b1c8dbf

Please sign in to comment.