Update Iterated battle #124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does two things, first it updates the Iterated battle code to be a bit easier to read while leaving the functionality practically the same. The only difference is that previously when the step size was reset after a generator failure was 4, not 1 as it is at the start of the battle. I think this is a bug so the new code doesn't retain that behaviour.
The second part is adding the feature requested in #70. A new setting
max_generator_errors
can be set to either an integer or "unlimited", if it is an integer the battle will skip any future fights and award the solving team with the current maximum score. Note that this might not be the cap as set in the config, if eg the generator first succeeds all the way to size 1000, where the solver fails, but then fails enough to cause a skip at sizes 900-950 the solver will only achieve a score of 1000, not the cap set in the config.