On 03/09/2015 16:29, Linh Chi Nguyen wrote:
Dear All,
I'm a complete newbie in racket and need help in coding finite state
machine/automata. Please pardon any of my ignorance.
Thanks to this post of Tim Thornton, I see a very good way to code FSM:
http://timthornton.net/blog/id/538fa6f2f09a16ba0674813d
Looks interesting! When I first heard of finite state machines they were
presented to me as an abstract model
of computers in general. AFAIR finite state automatons are used to teach
how to realize really fast orthography checks but for me these were more
connected to the concept of directed cyclic graphs.
HERE IS THE QUESTION:
Using this way, after each event, there'd be a NEW automaton created.
That's because of pure functional programming as the post states.
So I'm worried about scaling. I'd like to generate 100 automata. In each cycle,
I'd pair the automata to interact for 50 times. Which means that there'd be 100
new automata created for every single cycle. And I'd like to run at least 1000
cycles.
Would there be any problem with scaling? If yes, is there a way around this?
With the knowledge of a regular computer already being such an automaton
(in some way) I have learned
to appreciate the /case/ form for data driven programming. Especially if
one doesn't care about past states (which will need memory one way or
the other) it's probably better to describe the automaton "from inside"
and see the whole program (or some part of it) as an automaton. For
event driven programs nowadays (at least in Racket) we only need to
define the actions as regular procedures or callbacks.
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.