yohang / Finite

A Simple PHP Finite State Machine

Home Page:http://yohan.giarel.li/Finite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature request] Markov chain

rafis opened this issue · comments

In finite state machine all transitions has probability of 100%, in Markov chain this probability can be configured.

Modifications are need to be done:

  • store probability in transition
  • can() should return true then probability > 0%
  • add function selectTrasition() which will select next transition randomly from available

Btw, are transitions support conditions? Transitions probability can be either float or callback, callbacks are needed to check condition and their return probability and can return probability 0%.

That's not a bad idea, but not planned for 1.1.