18.1. 有限ステートマシンとはなにか¶ 有限ステートマシン(FSM)は実際には機械ではなく、有限個の状態を持ったものです。 私は有限ステートマシンを理解するときは、グラフやダイアグラムで理解したほうが簡単だと気づきました。 例えば、次の図は(とても馬鹿な)犬を状態マシンとして簡潔にダイアグラムにしたものです。 ここで、犬には3つの状態があります。座る(sitting)、吠える(barking)、しっぽをふる(wagging)の3つです。 異なるイベントや入力が状態を変更させるでしょう。 もし犬がおとなしく座っているときに、リスを見かけたら、犬は吠え始め、あなたが撫でてあげるまで吠えるのを辞めないでしょう。 一方で、犬が座っているときにあなたが撫でてあげたら、何が起きるかはわかりません。 Erlangの世界では、犬はクラッシュします。(そしていずれスーパバイザによって再起動されます。)
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く