答案1
虽然应该发布一个代码来展示已经尝试过的方法来解决这些问题,但我想对这个automata
库进行一些尝试。这是一个解决方案
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{positioning}
\usetikzlibrary{automata}
\begin{document}
\begin{tikzpicture}[node distance = 1cm and 2cm, > = Stealth, accepting/.style = accepting by arrow]
\node[%
state, rectangle, fill = red,%
accepting, accepting text = {$(\mu + \omega_1)\mathrm{A}$}] (A) {A};
\node[%
state, rectangle, fill = blue!40!white, above right = of A,%
initial above, initial text = {$(1 - p)\mu v$},%
accepting, accepting text = {$\mu\mathrm{E}$}] (E) {E};
\node[%
state, rectangle, fill = green, below right = of A,%
accepting, accepting text = {$\mu\mathrm{Q}$}] (Q) {Q};
\node[%
state, rectangle, fill = yellow, below left = of A,
accepting left, accepting text = {$(\mu + \omega_2)\mathrm{R}$}] (R) {R};
\node[%
state, rectangle, fill = green!30!white, above left = of A,%
initial above, initial text = {$p\mu v$},%
accepting left, accepting text = {$\mu\mathrm{S}$}] (S) {S};
\path[->] (A) edge[bend right] node[above left] {$\pi\mathrm{A}$} (R)
(E) edge node[above left] {$\varepsilon\eta\mathrm{EA}$} (A)
(E) edge node[right] {$\lambda\mathrm{E}$} (Q)
(R) edge[bend right] node[near end, below right] {$\rho\mathrm{R}$} (A)
(R) edge node[below] {$\theta\mathrm{R}$} (Q)
(S) edge node[above right] {$\varepsilon\mathrm{SA}$} (A)
(S) edge node[above] {$\gamma\mathrm{S}$} (E);
\end{tikzpicture}
\end{document}