We might continue this topic once we've finished working on this state machinejshpro2 wrote:Yeah... that's what I was getting at. Why not define "constraints" and hueristic cost functions and let the computer search the state space. For instance a solution that drove the car into an obstacle would impede the goal solving and thus would rank lower on the hueristic. That's what I was trying to get at is though technically any logic can be "serialized" into a linear flow like this, that is just one paradigm to define the logic. You would still need a framework that defined the constraints though
So, I wrote a lot of code to do this. I'd have preferred to create a FSM that sits separately to the Car class and somehow "configure" or "build" a generic FSM in the Car. Unfortunately I don't think this is going to work very nicely in PHP due to lack of lambda style functions (at least, decent ones) or anonymous objects.
I'm still unclear how a lookup table comes into play... I'm assuming that the table I wrote before is basically what the lookup table would contain, and the FSM uses that to switch states, somehow?