What are finite state machines and why does a programmer know about them?

Umm - what the question said. This is what I hear all the time, but I have not yet had time to study it.


(updated) I could find a definition ... but why not (as @erikson pointed out) get an idea of ​​your real experiences and jokes. Community Wiki'd incase, which helps people vote for the most insightful answer. Interesting reading so far, thanks!

+5
source share
12 answers

The short answer is a method that you can use to express systems with specific states (as opposed to quantum states / probability distributions).

Quote Wikipedia article :

(FSM) ( : ) , , , . .

, ? , () () , . , AB + C (, ). , , "ABC", "ABBC", "ABBBC" .. C B ( ).

, . ( ), , A () , C () .

      _
     ( ) 
A --> B --> C

FSA , Turing Machines.

. , , . : " C . ".

+13

, , . , -, , . - , , - , . , , , : " " " " : " " " ".

, , , . - , , . . , , ( FSA. )

, FSAs, , : , , -, . .

FSA F = & lang; & Sigma;, S, s 0, F, & delta; & rang; & Sigma; - , S - , s 0 & isin; S - , F & sube; S & delta;: S & times; & Sigma; β†’ S - .

+9

: , , () , .... ! !

, , . : " , " .

, - , -, ... ,

+5

, , "-" .

AI, NPC , , , - :

  • NPC_STATE_IDLE
  • NPC_STATE_ALERT ( 100 )
  • NPC_STATE_ENGAGE ( NPC)
  • NPC_STATE_FLEE ( )

FSM , FSM.

+2

, , .

- , - - URL-, URL- .

, , - FSM, URL-.

. , , , " " - . , " ". .

FSM switch, . - . . -.

FSM , , . , 1000 . 1000 , .

FSM , , . FSM , . , , , , , .

FSM , , , . ( , ). , - , .

+2

. , FSA - , , , . , , , , . - FSA, :

  • while-switch-on-state

  • goto-net (!)

... .

- , - FSA, , , , .

+2

: "" , , , ... .

"" , , .

, , "" , , . .

(: DFA NDFA - )

+2

(, ), .

: , , .

, ( " " ) , - / ( " " ) .

, , FSM , , .

+1

FSA - , , , , . ( ). , , . , PARC.

FSAs - , , , , .

+1

, , - . ( ) .

+1

FSA ( DFA NFA) , , . , markov FSA, NLP ( ), AI ( ), ..

One of the drawbacks of the FSA is that they are usually slow and usually difficult to implement and difficult to understand or visualize when reading code, but they are good because they usually provide general solutions to problems and they are well known through a lot of FSA research.

+1
source

All Articles