Comments (3)
Thanks for the question, @aleneum! Support for hierarchical states has been suggested before (#31); to recap: I think it would be nice, as long as the implementation can be made relatively compact. I'm happy to consider PRs or to discuss potential implementations, but probably won't have time to implement this myself any time soon, so it would fall to someone else to do it.
With respect to concurrent states, it depends on what you mean. If you mean support for being in multiple states at once, but still in a single-threaded context, I'm willing to consider something along those lines---though I'd need to be convinced that there's a real need for it. I guess my intuition is that most potential use cases could be reduced to either (i) making states hierarchical (so, this amounts to implementing hierarchies, as above), (ii) implementing multiple Machine instances, or (iii) refactoring the states so that you encode all possible combinations of desired states as discrete states.
On the other hand, if you're talking about concurrency in the sense of multithreading (see discussion in #30), then that's definitely not on the agenda, as I think it would be a beast to get right.
Since this has come up before, I'll mark it as help wanted and leave it open.
from transitions.
Thank you for your fast and detailed answer. I missed to check the closed issues. My thoughts went into the same direction as described in #31 and I would be happy to contribute (or at least give it a shot) if you consider this a promising road.
About concurrency: I agree with you that in most cases its preferable to redesign rather than using concurrency. Since it is problematic not just on the programatic level. It's also tough to debug and hard to comprehend and follow, especially if you have not worked with the code before.
It just seems to be a required and used feature in our robotic department (which also looks for a new state machine). I better check with the guys again about what they need. I assume they have cases like:
planTrip ----> checkEnvironment
| |
V V
checkSelf ------> doTrip
where multiple settings and sensors have to be prepared and checked before something can be done. So yeah, the execution context is probably multithreaded, distributed and hell. I guess thats why they also want to rework they current solution :).
Thank you for your input so far. I will tinker around a bit and if we decide to build upon transitions I will probably contact you again.
Best regards,
Alex
from transitions.
Added in b327706. Thanks again, @aleneum!
from transitions.
Related Issues (20)
- AsyncMachine transitions fail when a list of `State` objects are passed in to the FSM. HOT 2
- get_triggers does not work HOT 3
- Cannot use Pydantic `BaseModel` class for models HOT 2
- All possible transitions are initialized, instead of those provided as an argument. HOT 2
- Machine get into wrong state. HOT 1
- after_state_change not triggered by set_state HOT 2
- AsyncMachine with queued transitions breaks when transition is cancelled
- AsyncMachine transitions aren't atomic
- The Event and Machine have cyclic dependency. HOT 3
- Update COPR packages
- get_triggers does not get child states in HierarchicalAsyncMachine HOT 1
- may_ function in parallel state does not report correct value
- 3.12 Performance HOT 9
- Call triggers by name HOT 2
- New version release HOT 5
- Very confusing in inherited HierarchicalMachine. HOT 1
- Pylance attributeerror on generated members HOT 6
- 😭 How do you specify final state? The front page docs do not say HOT 1
- Is it normal to have a bunch of warnings of "event doesn't exist" for parallel machines (with disjoint event sets)? HOT 1
- Provide features to ease static type checking HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transitions.