views:

1065

answers:

3

Does anyone have a solution for a basic, compact Finite state machine/automata written in Objective-C code?

I am interested in reusable components so that the FSM have states added and actions defined that use reusable state classes.

A: 

I did this in Java. Might be ported... In addition to the reusable components, the state machine itself can be defined in an array (as data), which makes it really easy to use.

http://code.google.com/p/state-machine/

If you wanted to try to port it, I could probably help.

Bill K
Excellent. I have already written one in C++ for a university game that I wrote. I'll take a look at yours.
Brock Woolf
Okay it looks like a big project. In that case I am busy for the next few days I will have to take a look at it afterwards.
Brock Woolf
+1  A: 

What you want is a rules engine... oddly, I was able to find only one for objective-C (BDRuleEngine) and that is rather out of date:

http://eschatologist.net/bDistributed.com/index.html

It might be the best starting point though, unless you want to port something.

Kendall Helmstetter Gelner
Nope, not looking for a rules engine.A basic FSM with reusable classes is what I want. I wrote one in about 200 lines of C++ in about 3 classes. Hoping someone had one already coded in Obj-C. looks like ill have to do it myself.
Brock Woolf
A: 

Hi,

take a look here www.sinelabore.com It translates UML state charts into Objective-C (beside C/C++).

Peter