% ------------------------------------------------------------------------------
% Copyright (c) 2019, 2025 Contributors to the Eclipse Foundation
%
% See the NOTICE file(s) distributed with this work for additional
% information regarding copyright ownership.
%
% This program and the accompanying materials are made available under the terms
% of the MIT License which is available at https://opensource.org/licenses/MIT
%
% SPDX-License-Identifier: MIT
% ------------------------------------------------------------------------------
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, arrows, automata, positioning, shapes, shapes.misc}
\usepackage[paperwidth=40in, paperheight=20in]{geometry}

\begin{document}
\pagestyle{empty}

\begin{tikzpicture}[
    auto,
    ->,
    node distance=5cm,
    every state/.style={ellipse, semithick, fill=black!5, minimum size=2cm, font=\Large},
    initial distance=1.2cm,
    every initial by arrow/.style={-{Stealth[scale=1.4]}},
    initial text=,
    transform shape,
    double distance=2pt,
    every loop/.style={min distance=10mm}
]

\node[state, initial, accepting]      (A)   {\emph{Closed}};
\node[state, below of=A]              (B)   {\emph{PartiallyOpen}};
\node[state, right of=B]              (C)   {\emph{Open}};
\node[above left=.5cm and -.5cm of A] (txt) {\textbf{BridgeDeck}};

\path[-{Stealth[scale=1.4]}]
    (A) edge[bend left, above] node[align=center,right] {\texttt{partially\_opened}} (B)
    (B) edge[bend left, above] node[align=center,left]  {\texttt{closed}}            (A)
    (B) edge[bend left, above] node[align=center,above] {\texttt{opened}}            (C)
    (C) edge[bend left, above] node[align=center,below] {\texttt{partially\_opened}} (B)
;

\node[state, initial, accepting, right=7cm of A] (D)   {\emph{Green}};
\node[state,                     right of=D]     (E)   {\emph{Red}};
\node[above left=.5cm and -.5cm of D]            (txt) {\textbf{TrafficLight}};

\path[-{Stealth[scale=1.4]}]
    (D) edge[bend left, above] node[align=center] {\texttt{to\_red}}   (E)
    (E) edge[bend left, below] node[align=center] {\texttt{to\_green}} (D)
;

\end{tikzpicture}
\end{document}
