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

decreasing, spike, decreasing pattern: ceiling function should be applied to minimum spike value #47

Closed
chanko08 opened this issue Apr 9, 2020 · 3 comments · Fixed by #93
Labels
prediction Prediction / Calculation Issues

Comments

@chanko08
Copy link

chanko08 commented Apr 9, 2020

Based on my own turnip prices, and Treeki's original gist, I think there is a small inaccuracy with the spike in the "decreasing, spike, decreasing" pattern. Here's output from the website for my turnip prices (note the 86 value in both predictions):

issue

According to the site, the min for when the spike starts is 86, but this is inconsistent with the Treeki's original gist. For this pattern, the spike values are calculated like so:

sellPrices[work++] = intceil(randfloat(0.9, 1.4) * (float)basePrice);
sellPrices[work++] = intceil(randfloat(0.9, 1.4) * basePrice);
rate = randfloat(1.4, 2.0);
sellPrices[work++] = intceil(randfloat(1.4, rate) * basePrice) - 1;
sellPrices[work++] = intceil(rate * basePrice);
sellPrices[work++] = intceil(randfloat(1.4, rate) * basePrice) - 1;

So for basePrice=96, the min for the start of the spike should be ceil(0.9*96) = 87. Forgive me, I'm not 100% certain of the relevant part in the code, but it appears to be here where instead of Math.floor it should be Math.ceil

This was referenced Apr 13, 2020
@mikebryant mikebryant added the prediction Prediction / Calculation Issues label Apr 14, 2020
@ZZZZzzzzac
Copy link

i guess this is closed by #93?

@theRTC204
Copy link
Collaborator

theRTC204 commented Apr 16, 2020

Yup, I think you're right! https://turnipprophet.io/?prices=96.47.43.39.36.33.28

@theRTC204
Copy link
Collaborator

Going to close this issue as it appears to be fixed now. Feel free to open a new issue if you think there's still a problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prediction Prediction / Calculation Issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants