Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [state-machine]

A state machine is a model for designing systems which change based upon their current state and what input they receive.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
307 views

STTCL FSM framework based on the GoF State Pattern, Part I: The basic interfaces

Preface I have decided to let my pet project created some years ago to undergo a code review here. The review will be broken into parts according to meta question Multiple reviews or one big review?...
5
votes
0answers
2k views

Reducing complexity in NSView event handling code in Swift

My Cocoa event code always tends to descend into madness, I need to advice on how to reduce complexity. I've spend a few hours putting this example together. CanvasView is a layer hosting subclass of ...
4
votes
0answers
631 views

Finite Automata stub in Rust

I wrote a finite automata implementation in C years ago. C's access to mutable, unsafe, raw pointers made it quite simple for me to link/relink the states of a finite automata. I read the official ...
4
votes
0answers
846 views

C++ Finite State Machine - follow-up

This question is a follow-up from Object Oriented Finite State Machine. I vastly improved commenting and followed the suggestions from the answer. Additionally, I improved my tests and did some more ...
3
votes
0answers
23 views

Hardware Clock Divider

I have created a clock divider that works as follows: If the division factor is 0, pass the clock through unchanged. Otherwise, flip the output clock signal after the specified number of input clock ...
3
votes
0answers
61 views

static macro-based State Machine implementation

While learning Rust for the past couple of weeks, I set out to use the type-system to build a static State Machine implementation in Rust. The goals: program in idiomatic Rust no runtime overhead ...
3
votes
0answers
71 views

Finite State Machine to segment Thai syllables

I am developing a FSM to segment Thai syllables with the following rules: Here are my util functions: ...
3
votes
0answers
53 views

“Academic interest” implementation of a Finite State Machine

Context I'm playing around the concept of a Finite State Machine. While I understand the basic principles behind it, I want to implement a simple, yet generic class which could be reused in the ...
3
votes
0answers
82 views

STTCL FSM framework based on the GoF State Pattern, Part III: Policy based design of higher level State Machine constructs

Preface I have decided to let my pet project created some years ago to undergo a code review here. The review will be broken into parts according to meta question Multiple reviews or one big review?...
3
votes
0answers
385 views

Linear finite state machine in ES6

I would love some feedback on my linear finite state machine. I say linear, as it can only handle one state at a time. I am also giving my method of how I -work- with the state machine, as I would ...
3
votes
0answers
38 views

Backbone.model based state machine

I have created a class to keep track of some internal states. You can see it as a very simple implementation of a state machine ...
3
votes
0answers
117 views

Extracting dynamic behaviors of state machines to modules

This is my initial class. (I am not trying to reinvent state-flows again, just practicing) As you can see straight forward, it dynamically generates methods like .recommend,.recommend!, ....
2
votes
1answer
198 views

Simple state machine based command-line argument parser

I'm in the process of learning to write idiomatic JavaScript code so naturally I'm parsing command line arguments. My approach to this is to have a simple state machine. The parser should work as ...
2
votes
0answers
55 views

Time-dependent state machine with two outputs

Given a class BasicDataFeed whose purpose is to feed questions and answers into an artificial neural network, which is tested in a non-negotiable manner as follows: ...
2
votes
0answers
49 views

STTCL FSM framework based on the GoF State Pattern, Part II: Abstraction of asynchronous/concurrency features

Preface I have decided to let my pet project created some years ago to undergo a code review here. The review will be broken into parts according to meta question Multiple reviews or one big review?...
1
vote
0answers
23 views

Java UIState System

I am trying to come up with a UIState system that works well with Java UI. Before I show it I know I could add enums to help distinguish the states but I've left that out for simplicity. Here is what ...
1
vote
0answers
151 views

21 Game (Nim) as Finite State Machine in Python

Feedback from previous posts of mine suggested that my approach to states was haphazard, which is not surprising since I hadn't really thought of games in terms of states before. I have since gone off ...
1
vote
0answers
37 views

3 state switch for a table sort

I have a data table with 7 columns. The first column is the index that increases from 1 to N and is considered to be in ascending order by default. The remaining columns are unsorted. I need to be ...
1
vote
0answers
250 views

Deterministic finite automaton in Java - follow-up

(See the initial and first iteration for description and motivation.) Now I have incorporated all the remarks made by Tunaki, and it looks like this: TransitionFunction.java: ...