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

Conversation

Dullson
Copy link
Contributor

@Dullson Dullson commented Jan 1, 2023

Current PoE trade API returns at most 10k results per search which are not guaranteed to include the highest-scored items.
There were attempts to improve the situation by calculating a better min weight limit but that doesn't guarantee a solution.

This PR proposes an iterative approach to solve the issue. The new method keeps repeating the search as long as the results come out capped. Each time, the weight of the highest-rated item of the previous search is used as the new min weight limit.

During my tests, these recursive searches are usually completed within 2 steps. So I added an arbitrary limit of 5 max recursions to prevent any potential runaways.

The new method is only utilized in the search triggered by the query generator for now. Didn't want to make it default for URL-based searches as it changes the behavior.

@QuickStick123 QuickStick123 added the enhancement New feature, calculation, or mod label Jan 2, 2023
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 Dullson force-pushed the pobtrader_weight_adjusted_search branch from 7999e60 to b3654ae Compare January 2, 2023 16:10
@LocalIdentity LocalIdentity merged commit 5ace5ee into PathOfBuildingCommunity:dev Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, calculation, or mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants