View Full Version : State Machine Branching ?
g_jilek
02-24-04, 12:21 AM
Is it valid, i.e. fit within the IsoMax paradigm, to use IF ELSE THEN statements
in "CONDITION" to branch to different words or even different states?
Something like this:
IN-STATE XRAY
CONDITION TEST_REGISTER IF
CAUSES THIS_WORD
ELSE
CAUSES THAT_WORD
THEN
THEN-STATE XRAY
TO-HAPPEN
Or:
IN-STATE ZEBRA
CONDITION TEST_REGISTER IF
CAUSES
THEN-STATE ALPHA
TO-HAPPEN
THEN
THEN-STATE ZEBRA
TO-HAPPEN
Thank you for your INPUT.
Gerard
RMDumse
02-24-04, 06:42 AM
The CONDITION-CAUSES phrase is in essense an IF statement. the boolean evaluation which reaches the CAUSES determines a bifurcation in program flow, whether to fire, and do the action phrase and then go through with the state transition, or whether to go on to the next CONDITION-CAUSES associated with that particular state and make a new evaluation there.
Notice what is missing in the formulation you've shown is there is no way to do nothing. The CONDITION-CAUSES fires one way or the other. Depending on TEST_REGISTER you will do THIS_WORD
or THAT_WORD regardless. You could accomplish the same thing by using a TRUE CONDITION-CAUSES pharse then testing in the CAUSES-TO-HAPPEN action pharse, like this:
IN-STATE XRAY
CONDITION
TRUE
CAUSES
TEST_REGISTER
IF
THIS_WORD
ELSE
THAT_WORD
THEN
THEN-STATE XRAY
TO-HAPPEN
You see, the part gone missing is the ability of a state to wait. If every time you enter the state you go one way or another, then there is no way to wait.
Sometimes it is tedious to spell out the multitude of transitions necessary, and it can seem they have repetitive phrases. But so far, we have found it is necessary to be able to aptly describe all possible behaviors of the FSM.
g_jilek
02-24-04, 01:03 PM
With the CAUSES-CONDITION phrase acting as an IF statement is it valid to do
nested IF statements that would branch to different sates? Making sure that there
is a wait mechanism to maintain the FSM model.
Something like this:
IN-STATE ZEBRA
CONDITION
TRUE
CAUSES
TEST_REGISTER
IF
THEN-STATE
ALPHA
TO-HAPPEN
ELSE
THEN-STATE
BETA
TO-HAPPEN
THEN
THEN-STATE ZEBRA
TO-HAPPEN
Thanks again,
Gerard
RMDumse
02-24-04, 06:23 PM
There is some minimum security to how things can be put together, and I believe this configuration is also prohibited. Haven't tried to verify, though...
Anyway, no, this should not be done this way. States have individual and unique transitions from one state to another. There is no workable concept for splitting a transition with one origin into one that then goes three different ways. I think once you see the SDL (State Diagramming Language) we're working on, you will understand better. It's a CAD tool, where you draw statemachines, and it compiles to IsoMax(TM) source for output with all the states on machines, and all the transitions built on the states.
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.