rurel icon indicating copy to clipboard operation
rurel copied to clipboard

Can't represent a state from which there are no actions

Open RichoDemus opened this issue 1 year ago • 2 comments

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 :)

RichoDemus avatar Jul 25 '23 14:07 RichoDemus

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

HyperCodec avatar Oct 20 '23 15:10 HyperCodec

https://github.com/milanboers/rurel/blob/master/src/examples/weightedcoin.rs The weighted coin example demonstrates how to train with terminating states.

LeoDog896 avatar Mar 10 '24 23:03 LeoDog896