tkem / fsmlite

Lightweight finite state machine framework for C++11
MIT License
161 stars 25 forks source link

time complxity of this fsm #16

Closed choxsword closed 6 years ago

choxsword commented 6 years ago

I aprreciate the code you shared. But it seems that every time this fsm handles an event, it needs to search the transition table. So the time complexity for each call of process_event is O(N) (N is the count of rows) , not O(1), which makes this fsm unpractical .

tkem commented 6 years ago

For time complexity etc. see the references given in the README.

choxsword commented 6 years ago

sorry but i can't find the references in README. I only found a documentation of api. Could you please provide me a linkage?

tkem commented 6 years ago

fsmlite is a lightweight finite state machine framework for C++11. It is based on concepts first presented by David Abrahams and Aleksey Gurtovoy in C++ Template Metaprogramming, with additional ideas taken liberally from Boost's Meta State Machine (MSM).

choxsword commented 6 years ago

I look through the linkage of MSM but still not found anything explicitly about time complexity. By the way, is there anything wrong with my analysis of O(N) complexity about your code above?