state-machine

What are some strategies for testing large state machines?

我们两清 提交于 2019-12-04 07:53:09
问题 I inherited a large and fairly complex state machine. It has 31 possible states, all are really needed (big business process). It has the following inputs: Enum: Current State (so 0 -> 30) Enum: source (currently only 2 entries) Boolean: Request Boolean: Type Enum: Status (3 states) Enum: Handling (3 states) Boolean: Completed Breaking it into separate state machines doesn't seem feasible, as each state is distinct. I wrote tests for the most common inputs, with one test per input, all inputs

Which State Machine execution frameworks for C++ implement UML semantics?

不羁的心 提交于 2019-12-04 07:21:22
I'm looking for a framework that provides execution of hierarchical state machines (HSMs). These are the requirements for the framework: Conforms to UML state machine semantics (as much as possible) Supports at least run-to-completion semantics hierarchical states entry and exit actions transition actions guards events with custom parameters Is object-oriented or does at least not prohibit OO designs The target platform is an medium- to large-sized embedded system with an OS. Do you know a framework that fulfills the above requirements? What are the pros and cons of your framework? Check out

Is there a Harel Statechart DSL tool for Java?

北城以北 提交于 2019-12-04 04:24:14
I'm looking for a tool that understands a DSL in which I can define my statechart that generates Java code or where the statechart in the DSL is runnable as is. The tool would ideally be written in Java and must support superstates and orthogonal regions by definition of Harel Statecharts (or equivalently UML 2 State Machines). Alternatively, what would be the best library or tool to write such a DSL with? ahcox Yakindu looks good: http://www.statecharts.org Harel Statecharts Visual Language Textual DSL Generates Java Generates C Generates C++ Generation configurable / customisable Eclipse

Rails cancan and State Machine - Authorizing states

可紊 提交于 2019-12-03 23:23:33
问题 I've been using the two awesome gems, state_machine and cancan recently in my rails application but I'm curious as to the best way to integrate them cleanly. Currently I've placed state transitions on buttons that go on actions authorized by the controller. This works perfectly, I can restrict who can perform that action. I would like to give the user the ability to change the objects state in the edit form as well. I've noticed that state_machine will pick up on the state_event key in the

How to get this Qt state machine to work?

不羁的心 提交于 2019-12-03 16:29:27
问题 I have two widgets that can be checked, and a numeric entry field that should contain a value greater than zero. Whenever both widgets have been checked, and the numeric entry field contains a value greater than zero, a button should be enabled. I am struggling with defining a proper state machine for this situation. So far I have the following: QStateMachine *machine = new QStateMachine(this); QState *buttonDisabled = new QState(QState::ParallelStates); buttonDisabled->assignProperty(ui_-

State machine versus RTOS for microcontrollers

梦想与她 提交于 2019-12-03 16:27:48
I stumbled across a free state machine tool . This appears to be for programming embedded systems graphically. By doing so, the author claims that the resulting code is more maintainable than if an RTOS had been employed. This tool is based on UML, which is nice to know, but has a steep learning curve. I would like to know what some of the more experienced programmers here think of this tool. I am developing an embedded application for the LM3S5P36 microcontroller. TI has an IDE called Code Composer Studio (CCS). I have not got into CCS yet, but I doubt it has the cool feature of being able to

Finite State Machine and inter-FSM signaling

社会主义新天地 提交于 2019-12-03 10:37:14
Recommendations for languages with native (so no FSM generation tools) support for state machine development and execution and passing of messages/signals. This is for telecoms, e.g implementation of FSMs of this level of complexity. I have considered Erlang, but would love some feedback, suggestions, pointer to tutorials, alternatives, particularly Java based frameworks. Maybe Scala? Open source only. I'm not looking for UML or regular expression related solutions. As this is for the implementation of telecoms protocols the FSMs may be non-trivial. Many states, many transitions, signal based,

Algorithm for implementing C# yield statement

杀马特。学长 韩版系。学妹 提交于 2019-12-03 08:14:46
问题 I'd love to figure it out myself but I was wondering roughly what's the algorithm for converting a function with yield statements into a state machine for an enumerator? For example how does C# turn this: IEnumerator<string> strings(IEnumerable<string> args) { IEnumerator<string> enumerator2 = getAnotherEnumerator(); foreach(var arg in arg) { enumerator2.MoveNext(); yield return arg+enumerator.Current; } } into this: bool MoveNext() { switch (this.state) { case 0: this.state = -1; this

Basic State Machine setup using Stateless

一笑奈何 提交于 2019-12-03 06:38:36
问题 I have some fairly simple state needs (for now). I think I would like to model these using the Stateless api. (But I don't really know much about state machines, so I could be wrong.) But I am getting caught up in the terminology (Specifically State and Trigger ) Here is an example: I have an order class. It is setup with several states. They are: New, Filled, Shipping, Completed, Cancelled. A few simple state rules I would like is that these state transitions are allowed: New (is the default

Finite automaton in Haskell

蹲街弑〆低调 提交于 2019-12-03 05:46:34
问题 What is a good way to represent finite automaton in Haskell? How would the data type of it look like? In our college, automata were defined as a 5-tuple (Q, X, delta, q_0, F) where Q is the set of automaton's states, X is the alphabet (is this part even necessery), delta is the transition function taking 2-tuple from (Q,X) and returning state/-s (in non-deterministic version) and F is the set of accepting/end states. Most importantly, I'm not sure what type delta should have... 回答1: There are