digraph DRC_Controller {
  rankdir=LR;
  splines=true;
  nodesep=1.2;
  ranksep=1.5;
  node [shape=circle, style=filled, fontname="Helvetica", fontsize=14, width=1.5, fixedsize=false];
  edge [fontname="Helvetica", fontsize=11];

  // States
  shutdown [label="SHUTDOWN\n(0,0)", fillcolor="#B3D9FF"];
  heatup   [label="HEATUP\n(1,0)", fillcolor="#FFFFB3"];
  operation [label="OPERATION\n(0,1)", fillcolor="#B3FFB3"];
  scram    [label="SCRAM\n(1,1)", fillcolor="#FFB3B3"];

  // Init
  init [shape=point, width=0.25];
  init -> shutdown [penwidth=2.0];

  // Transitions with guard conditions
  // S001: shutdown stays when !t_avg_above_min
  shutdown -> shutdown [label="!t_avg_above_min\n(S001)", color="#4477AA", penwidth=1.5];

  // T001: shutdown -> heatup when t_avg_above_min
  shutdown -> heatup [label="t_avg_above_min\n(T001)", color="#228B22", penwidth=2.0];

  // S002: heatup stays when inv1_holds & !(t_in_range & p_above_crit)
  heatup -> heatup [label="inv1 & !(t_range & p_crit)\n(S002)", color="#4477AA", penwidth=1.5];

  // T002: heatup -> operation when inv1 & t_in_range & p_above_crit
  heatup -> operation [label="inv1 & t_range & p_crit\n(T002)", color="#228B22", penwidth=2.0];

  // T003: heatup -> scram when !inv1_holds
  heatup -> scram [label="!inv1_holds\n(T003)", color="#CC0000", penwidth=2.0];

  // S003: operation stays when inv2_holds
  operation -> operation [label="inv2_holds\n(S003)", color="#4477AA", penwidth=1.5];

  // T004: operation -> scram when !inv2_holds
  operation -> scram [label="!inv2_holds\n(T004)", color="#CC0000", penwidth=2.0];

  // S004: scram stays when !manual_reset
  scram -> scram [label="!manual_reset\n(S004)", color="#4477AA", penwidth=1.5];

  // T005: scram -> shutdown when manual_reset
  scram -> shutdown [label="manual_reset\n(T005)", color="#228B22", penwidth=2.0];
}
