Browse Source

init commit

main
sp 4 weeks ago
commit
443a3fff8a
  1. 25
      main.tex
  2. 7
      util/packages.tex
  3. 10
      util/tikz.tex

25
main.tex

@ -0,0 +1,25 @@
\documentclass[11pt]{article}
\input{util/packages}
\input{util/tikz}
\begin{document}
\begin{stochasticModel}[2.5cm]
\node[state] (a) {$a$};
\node[state] (b) [above right of=a] {$b$};
\node[state] (c) [below right of=a] {$c$};
\node[dist] (a_alpha) [right of=a, xshift=-1.6cm] {};
\path[] (a) edge [action] node {$\alpha$} (a_alpha)
(a_alpha) edge [transition,sloped,below] node {$0.2$} (b)
(a_alpha) edge [transition] node {$0.8$} (c);
\node[dist] (b_alpha) [right of=b, xshift=-1.5cm] {};
\path[] (b) edge [action] node {$\alpha$} (b_alpha)
(b_alpha) edge [transition,sloped,above,bend right=100,pos=0.35] node {$0.2$} (a)
(b_alpha) edge [transition,below,pos=0.1,in=-110, out=-70,looseness=2] node[rotate=180] {$0.8$} (c);
\end{stochasticModel}
\end{document}

7
util/packages.tex

@ -0,0 +1,7 @@
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\usepackage{environ}

10
util/tikz.tex

@ -0,0 +1,10 @@
\NewEnviron{stochasticModel}[1][1.5cm]{%
\begin{tikzpicture}[node distance=#1,
thick,
action/.style={-,draw,sloped,above,pos=0.45},
transition/.style={->,draw,sloped,above,pos=0.5},
state/.style={circle,draw,minimum size=20pt},
dist/.style={circle,draw=black,fill=black,minimum size=4pt,inner sep=0pt}]
\BODY
\end{tikzpicture}
}
Loading…
Cancel
Save