rapid-router
rapid-router copied to clipboard
Improve "Algorithm Score" when winning a level
=> Basically the algorithm score depends on the number of blocks/instructions that are being used.
Ex, level 73, model_solution = [10] Indeed, the right solution has 10 blocks. A solution with 13 blocks gives you a score of 20-(13-10) = 17/20
Issues with current implementation / Feature
It's not explained so people might not know easily what to improve to make the score better In some levels you can find an algorithm with the same amount of blocks, but less efficient, than the good one - so you get all the algorithm points :( Is it a good idea to have hardcoded the correct solution length?
Ideas
The size seems intuitively important, true, but also The number of loops vs the number of repetitions… Ex: repeat 2 times moveLeft has three blocks, whether moveLeft ; moveLeft ; only has two… However the first algorithm is more "clever"... Compute the complexity?....
A standard complexity metric (cyclomatic complexity) would reward the second solution with a lower complexity. Maybe the second solution is better because it contains less lines and less complexity. For code it would be simpler to understand when only 2 moveLeft statements are required... But the preference is to penalise repetition in code.
If algorithm score rewards particular styles of code, then the score can be aggregated from multiple metrics.
- Number of lines
- Cyclomatic complexity (to reduce the number of loops and decisions)
- Repetition of commands?
Instead of hard coding, an ideal solution should be recorded, and the score can be stored or calculated at runtime. Lower value solutions by players in the game could be recorded.
@duncanrussell-ocado @mzywiol @faucomte @j4mesholland @dawidchodura The google doc is here: https://docs.google.com/document/d/1nFVKhDP0o1MAONo92xoATStz9MnVfuhkLS6If40dV4w/edit#
Can we please review the user stories together and then i'll put them in a github epic? Then we can create tasks more easily :) Looking forward to your inputs!
Still relevant
Still relevant
This is closely related to #1123 which is a bug that causes unintuitive scores for solutions, if a shorter solution is better. A proposed fix for that is #1125 but there was discussion about improving the whole basis of scoring which would fix #1123 in any case.