state-machine

UML state machine: How to exit orthogonal child regions?

浪子不回头ぞ 提交于 2019-12-05 23:48:41
Base on Wikipedia , I can have a hierarchical state decomposition, where I have multiple orthogonal regions, which can change state independently. The diagram shows how the orthogonal regions are entered. I assume that the entry happens in parallel in all regions. What I want to know is, how do you express the exit? If each region has an exit, does the global parent state exits when the first child region exit, or when they have all exited? I want to express that the exit happens when they have all exited. And how do you express that the global parent state transitions to the next global state

How to use machine learning to calculate a graph of states from a sequence of data?

六眼飞鱼酱① 提交于 2019-12-05 20:02:53
Generic formulation I have a dataset consisting of a sequence of points with 12 features each. I am interested in detecting an event in this data. In the training data I know the moments the event occurred. When the event occurs I can see an observable pattern in the sequence of points before the event. The pattern is formed from about 300 consecutive points. I am interested in detecting when the event occurred in a infinite sequence of points. The analysis happens post factum. I am not interested in predicting if the event will occur. Concrete example You may skip this section I am building a

How to reset state machines when unit testing C

半世苍凉 提交于 2019-12-05 17:40:50
I have a se of embedded C for a TI processor that need to be unit tested. For target compilation IAR is used but i am running the tests on a Win7 machine using MinGW GCC. In the C code there are functions containing state machines that sometimes need to be reset between tests. These state machines often keep their state variable locally static, making that task difficult if not impossible. I'm not very C++ class savvy but i had an idea about "importing" the C functions into a wrapping C++ class as memberfunctions making it possible to just create a new object whenever a reset i needed. The

Can somebody give an active record example for pluginaweek - statemachine?

偶尔善良 提交于 2019-12-05 16:11:06
Can somebody give a simple example on howto use pluginaweek state_machine for a ticket model with active record? I do not understand the complex examples from the docs. Example states: new -> accepted, declined, feedback accepted -> solved or feedback feedback -> accepted or solved Example ticket model (not tested) class Ticket < ActiveRecord::Base attr_accessible :name, :description attr_accessible :state_event validates :name, :presence => true state_machine :initial => :new do event :accept do transition [:new, :feedback] => :accepted end event :decline do transition :new => :declined end

State Machine Implementations

随声附和 提交于 2019-12-05 14:49:52
I am trying to build a board game ... And looks like it has to be implemented using a state machine.. I know of the State pattern from GoF, but I am sure there must be other ways to implement state machine. Please let me know.. if you know of any articles or books that contains details about different implementation (trade off of each of them), please direct me.. thanks Check out Ragel . We've used Harel's statecharts (similar/equivalent to state machines but somewhat easier to think about), there's a good book called Practical Statecharts in C/C++ . Here's a very simple FSM implementation:

Is there a Java equivalent to libevent?

為{幸葍}努か 提交于 2019-12-05 10:38:48
I've written a high-throughput server that handles each request in its own thread. For requests coming in it is occasionally necessary to do RPCs to one or more back-ends. These back-end RPCs are handled by a separate queue and thread-pool, which provides some bounding on the number of threads created and the maximum number of connections to the back-end (it does some caching to reuse clients and save the overhead of constantly creating connections). Having done all this, though, I'm beginning to think an event-based architecture would be more efficient. In searching around I haven't found any

REST - model state transitions

泪湿孤枕 提交于 2019-12-05 09:57:39
In REST - revertable DELETE a nice introduction on howto model state changes in REST was given. Basically, if you have a resource with a field status , you just put a new version of that resource with an update status field. In this topic, I would like to extend this model. Say you have a resource which can be in two states: 1 and 2. In contrast with the simple model as described in the cited post, there are three transitions to traverse from state 1 to state 2, instead of just one. My question is: how would you model state transitions in REST? I myself cannot come up with an RPC-like POST,

node.js with a statemachine

陌路散爱 提交于 2019-12-05 09:22:21
I understand that node.js is a single thread and is a single process in the memory, I'm working on a project employing state machine and wondering how that will work in this context. I'm feeling the states will be shared across users because it's a single thread or a single process. Calling out for directions/advices. let's say I've state A, state B, state C Application can only transition in this sequence, A -> B -> C Initial state is A, user 1 requests and as a result the state machine moves to state B and then finally state C user 2 requests, will the state machine for this new user be in

rspec: error on attribute (which exists) not found

若如初见. 提交于 2019-12-05 04:48:58
问题 I've got some problems specing a validation of my model, which acts as a state machine (gem state_machine 0.9.4). Via the stat_machine, I defined a validation for bikes in the state delivered: state :delivered do validates_presence_of :shipping_number end in my specs this works right: it "may not transit to :delivered without a shipping number " do @bike.state = 'delivered' @bike.shipping_number = nil @bike.save @bike.should have(1).error_on(:shipping_number) end but when specing like this:

DFA -> regular expression

时光毁灭记忆、已成空白 提交于 2019-12-05 00:08:28
问题 I've written a DFA on paper, and want to translate it into a set of regular expressions. Does anybody know a good tool to do this? 回答1: From my little google search, I found JFLAP. They also have a tutorial on how to Convert FA to regular expression. JFLAP JFLAP is software for experimenting with formal languages topics including nondeterministic finite automata, nondeterministic pushdown automata, multi-tape Turing machines, several types of grammars, parsing, and L-systems. In addition to