Boost logo

Boost Users :

From: Tim Milward (tim.milward_at_[hidden])
Date: 2006-05-03 09:02:29


>>If you only model external
>>transitions and want to use entry/exit actions you've essentially
>>lost much the power of HSM's to represent FSM's more efficiently.
>
>
> I don't follow. As I mentioned before, you can always simulate an
> internal transition with an external one. The only thing you have to do
> is to add one state:

OK, I didn't spot that previously. You are right that

S0
   entry/
   exit/
   E-local->S00/

   S00
     entry/
     exit/

is equivalent to

S0
   entry/
   exit/

   Intermediate
     E-external->S00

     S00
       entry/
       exit/

in terms of entry and exit actions (ie behavior).

However in a more complex example containing 3 levels of nesting you
can't apply the same trick.

S0
   entry&exit/
   E-local->S000

   S00
     entry&exit/

     S000
       entry&exit/

   S01
     entry&exit/

Adding an intermediate state containing S00 and S01 and moving E into
that but making it external is not equivalent. For example transitioning
  via E from S000 to S000 would call the entry & exit actions for S00.
Putting the intermediate state inside S00 doesn't work either because
you've lost the ability to transition from S01 to S000.

So I do think it's correct that local transitions are necessary to take
full advantage of HSM's to simplify FSM's in the presence of entry and
exit actions. However it remains to be seen how useful it is in practice.

> 1. The modification in the history case should be trivial and
> non-breaking, I guess I should be able to come up with a beta before
> next Sunday. Would you be willing to test it?

I would be glad to, but unfortunately I may be away around that time.
It's interesting that you have to treat shallow and deep history
separately, since the shallow history can (in theory) be automatically
determined from the deep history. [I'd like to see an nth level history
in UML. n=infinity is deep, n=1 is shallow, n<0 and you count levels up
from the bottom (for example).]

> 2. I'm unsure what's the best approach in the local transition case.
> Modifying the current behavior is out of the question for reasons of
> backwards-compatibility. One option is to introduce sc::local_transition
> and sc::simple_state::transit_locally() but I'm not sure whether that
> would be such a good idea as it adds yet another way of expressing
> something that can easily be achieved with little additional work.
>
> I would be interesting to hear
> some real-world experience in this case.

Something to think about then. I don't have a good enough understanding
of the library yet to comment on the best approach. When I come across
any real examples in my work that need local transitions I'll let you know.

Yours,
Tim Milward.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net