rurel
rurel copied to clipboard
Can't represent a state from which there are no actions
Hey! cool crate, I'm playing around with it a bit. I realized that I can't seem to represent a state from which there are no actions, I'm training a model to play a game and in this game there are some "end states" like the end of the game where you're scored on your performance, but if I have my State::actions function return an empty vec I get a div/0 error here :https://github.com/milanboers/rurel/blob/40d0fa7116c528953780b74e0a19756182a70a72/src/mdp/mod.rs#L22C59-L22C59
since there are no actions. Maybe I'm just misunderstanding how this is supposed to work :)
it's probably dividing by the length of your actions vec.
your State::actions
should return all possible actions the AI can make, it'll select from those for the output.
edit: they should prob make an explicit panic if it detects the actions length as 0 though to not confuse people
https://github.com/milanboers/rurel/blob/master/src/examples/weightedcoin.rs The weighted coin example demonstrates how to train with terminating states.