c++ - State machine implementation -
I have a state machine as described below.
We can start in one of the two early states, but we have to kill all four states of handicrafts. From there, we can either transfer the payload of data or get a payload of data. After that, we return to our original starting position.
Handshake:
-> Initial Step 1 -> LastState 1 -> Initial Step 2 -> LastState 2
-> Initial Step 2 -> FinalText 2 -> Startgate 1 -> Finalist 1
Payload Transfer:
-> Send SendPage -> Sendend -> Startup Starts?
-> ReceiveLoad -> Received -> StartState?
The code below shows my existing architecture. Unfortunately, at the end of each process, I do not have enough information from within the states, to know what hit I should do to the next state .
Do anyone have any suggestions on how to improve this architecture?
Thanks, Paul H
which does not fully display the possible state of your system, but It is easy to change so that it can be done. You need additional states to represent the difference between being in states and not in state 2, and when in the state 1, when the state is in 2 (and the same for state 2). Then you need it:
S1 S2 F1 F2 S12 F12 S21 F21 SP SE RP
with transition
< Code> S1 - & gt; F1F1 - & gt; S 12S 12 - & gt; F12 F12 - & gt; SP or F12 - & gt; RPS2 - & gt; F2 F2 - & gt; S21 S21 - & gt; F21 F21 - & gt; SP or F21 - & gt; RP SP - & gt; SE RP - & gt; RE SE - & gt; S1 or SE - & gt; S2 RE - & gt; S1 or RE - & gt; S2
Important difference is the introduction of new states S12
, F12
, S21
and F21
. In terms of implementation you can almost certainly get the F21 from S2 to S12, F2 to F12, S1 to S1 and F21 and to transition the function to go to the right position. .
states).
Comments
Post a Comment