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

Refine ALLOCATE AVAILABLE search to converge under broader conditions #139

Closed
ToddFincannon opened this issue Oct 13, 2021 · 1 comment · Fixed by #141 or #190
Closed

Refine ALLOCATE AVAILABLE search to converge under broader conditions #139

ToddFincannon opened this issue Oct 13, 2021 · 1 comment · Fixed by #141 or #190
Assignees
Labels
Milestone

Comments

@ToddFincannon
Copy link
Collaborator

The ALLOCATE AVAILABLE C implementation searches the x axis for a value that allocates available resources according to the given priority profile (see #100 for details). The current algorithm worked well for the example model in the Vensim docs, but fails to converge for two much larger priority profiles in EPS.

@ToddFincannon ToddFincannon added this to the 0.6.0 milestone Oct 13, 2021
@ToddFincannon ToddFincannon self-assigned this Oct 13, 2021
@ToddFincannon
Copy link
Collaborator Author

The problem turned out to be that the spread of priority values (means) in EPS is much larger than the example. The search algorithm needed to skip over much bigger steps in the beginning to find the x value where the allocations converge. I scaled the initial search delta to the spread of the means to get the right size. I also needed to increase the allowed number of search steps to 100, since the algorithm needed as many as 60 steps to converge in EPS. This is still a pretty fast process.

I added an optimization that skips the normal curve calculation if the requested quantity for a requester is zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment