Features:
- Tests!
- maintain index of all training-cases
- update distance of training-cases after every evaluation (only update cases that are in the downsample)
- when an individual passes all of the DS cases, the population is re-evaluated on all training-cases to see if they pass all of them. If so, evolution is completed and training is complete. (they are then tested on held out test set and performance is reported)
Since removing 'read-string' and 'str' from middle-character and twitter seemed to help diversify the outputs, we chose to replace all other occurrences of this pattern from the other PSB2 problems. Additionally, this conversion with 'read-string' and 'str' was completely unnecessary since the program was already taking from the top of the string stack.
Select k random elements in plushy. Delete these, and see if the plushy's behaviors are still identical. If they are, this is now the current plushy. If not, decrease k with a certain prob, and try again.
Upon further inspection, Richard and I realized that we didn't need to have `parsed-outputs` at all in problems that just return a string (take the top value from the `:string` stack).
So we removed all that from the Middle Character and Twitter problems, and removed the unnecessary calls to `str` in the `levenshtein-distance` calls.
Co-authored-by: RichardLussier <lussi036@morris.umn.edu>
For some reason `read-string` was being called to parse a string to a string in Middle Character, along with a totally unnecessary try/catch block.
This cleans that up.
It looks like most if not all of the PSB2 problems have this issue and we'll need to go through and update all of those to not use `read-string`.
This replaces the dangerous use of `read-string`with `parseInt` and `parseFloat`, and returns `ignore-instruction` if an exception is thrown when trying to do the parsing.
Hopefully this will fix the stack overflow problems with the PSB2 Middle Character and Twitter problems.