Ocean Bird Finite State Automata

digraph G {
  subgraph cluster_0 {
    style=filled;
    flap_down -> mid_flap
    mid_flap -> flap_up
    flap_up -> mid_flap
    mid_flap -> flap_down
  }

  subgraph cluster_1 {
    style=filled;
    target_select -> begin_dive
    begin_dive -> dive_body
    dive_body -> fish
    dive_body -> land
  }
  
  subgraph cluster_2 {
    style=filled;
    nest -> sleep
    sleep -> sleep
    sleep -> wake_up
  }
  
  land -> nest
  wake_up -> fly
  start -> fly -> mid_flap;
  start -> dive -> target_select;
  start -> unload -> end
  mid_flap -> start
  fish -> start

  start [shape=Mdiamond];
  end [shape=Msquare];
}