Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complementary AND-decomposition #504

Open
BorisGerretzen opened this issue Jan 3, 2023 · 3 comments
Open

complementary AND-decomposition #504

BorisGerretzen opened this issue Jan 3, 2023 · 3 comments

Comments

@BorisGerretzen
Copy link

BorisGerretzen commented Jan 3, 2023

I am currently implementing state machines according to UML diagrams provided by a standard but they are using what they call 'AND substates', or what wikipedia calls 'complementary AND-decomposition', 'Such decomposition means that a composite state can contain two or more orthogonal regions (orthogonal means compatible and independent in this context) and that being in such a composite state entails being in all its orthogonal regions simultaneously'. In practice this means that I need to have two or more active states at one time, does this library support that?

For some context, it's a representation for the connection state of a piece of equipment. During the initialization the equipment simultaneously attempts a connection to the host and listens for an incoming connection from the host. If any of these are successful we transition out of the composite state and into the connected state. How could I best represent this using this library?

It is possible to manually rewrite these composite states to non-composite ones but that results in a bunch of extra transitions and the possibility of me making mistakes during the rewriting.

@mclift
Copy link
Member

mclift commented Jan 3, 2023

Stateless doesn't support being in multiple concurrent states. It sounds like you may need multiple state machines to model this.

There's a similar discussion in issue #442: #442 (comment), where @HenningNT suggested a few approaches.

I hope this helps. I'd be interested to find out how you end up approaching this.

@BorisGerretzen
Copy link
Author

Ah okay that's a shame, are there plans to add it or is it something that won't be supported?

What I've done for now is I've expanded the composite state to a nonorthogonal equivalent.
image
This worked for me because I only have a couple states, once it gets bigger I think another solution would fit better.

@mclift
Copy link
Member

mclift commented Jan 18, 2023

I'm not aware of any plans to add support for orthogonal states currently (I can't speak for the other maintainers; perhaps they know different?). Adding support for this sounds like a really interesting project but it would need some careful thought given that the library is currently based on the principle of being in exactly one state at all times. If you have any thoughts on how to approach it, I'd be really interested to hear them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants