Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoB Trader: add self adjusting weighted search to prevent result clipping #5510

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(pobtrader): change weight step to average
Current implementation performs full step jumps between searches
which result in very few results in the last search URL, new method
performs half step searches to produce search URLs with more results.
Dullson committed Jan 2, 2023
commit 22d26a3d64eb5416e735d89b9574d146a485805b
2 changes: 1 addition & 1 deletion src/Classes/TradeQueryRequests.lua
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ function TradeQueryRequestsClass:SearchWithQueryWeightAdjusted(realm, league, qu
previousSearchItems = items
local highestWeight = items[1].weight
local queryJson = dkjson.decode(query)
queryJson.query.stats[1].value.min = highestWeight
queryJson.query.stats[1].value.min = (tonumber(highestWeight) + queryJson.query.stats[1].value.min) / 2
query = dkjson.encode(queryJson)
self:PerformSearch(realm, league, query, performSearchCallback)
end)