3 ms·
Not sure why I am being downvoted here. A FSM would make things very hard to read compared to a BT. The fact that you would have to use a stack to pop events s
by seivan 11y ago
Not sure why I am being downvoted here.
A FSM would make things very hard to read compared to a BT.
The fact that you would have to use a stack to pop events shows that it might not be the best suited use.
- hvidgaard 11y agoThere is nothing that dictates that you use a stack when designing a FSM. I'm not going to argue that a BT wouldn't be a good solution, I'm sure it can be used to make a reasonable one. In any case, a well designed FSM would get you a long way. Since the input (pressed buttons) is finite, you can cover every single case and weight according to importance of floor and wait time.
- seivan 11y agoI was actually promoting a stack as that would make things easier, but it's still tacked on a solution that isn't as good. A well designed FSM doesn't necessarily mean an easily read FSM. I always try to draw states and transitions on paper, and I end up making a mess. That could be a flaw on my side. But I won't be making the same mess with BT. I don't see how a FSM could avoid having transitions back and forth. * Elevator is on level 3 * A person in the elevator wants to go to level 4 * A person waiting for down on level 5 * A person in the elevator wants to go to level 2 * A person waiting for down on level 2 FSM would need to track current floor and direction. Would need guards/predicates on transitions for inputs Could just be me, but I wouldn't be able to draw a pretty picture with those.