center-randomize
center-randomize copied to clipboard
Auto rerun if all students are not allocated
Summary
On the readme file it says
Run the program and re-run if
- Any school has students who have not been assigned a center.
This feels very weird.
It would be very userfriendly if all the students are allocated on the single go.
Proposed solution
Keep the list of students that are not allocated and try allocating them if they are not allocated at the end of the run.
The way this is implemented, allocation of all students cannot be guaranteed. However we may re run the app until all students are allocated. We would also need to set a max retry count (say 10) and show error message if it fails more than that. In such case we need to revisit to see if more centers need to be added or more capacity is needed
I have created a PR with the changes. This should rerun default 10 times if the allocation failed and also the retries can be updated with the arguments.