From 443a3fff8a0fb849aad4008a5c8fbbc87d8f1329 Mon Sep 17 00:00:00 2001 From: sp Date: Wed, 27 Nov 2024 14:42:01 +0100 Subject: [PATCH] init commit --- main.tex | 25 +++++++++++++++++++++++++ util/packages.tex | 7 +++++++ util/tikz.tex | 10 ++++++++++ 3 files changed, 42 insertions(+) create mode 100644 main.tex create mode 100644 util/packages.tex create mode 100644 util/tikz.tex diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..e407e2d --- /dev/null +++ b/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} diff --git a/util/packages.tex b/util/packages.tex new file mode 100644 index 0000000..5584c7e --- /dev/null +++ b/util/packages.tex @@ -0,0 +1,7 @@ +\usepackage[ngerman,english]{babel} +\usepackage[utf8]{inputenc} +\usepackage{geometry} +\usepackage{tikz} +\usetikzlibrary{automata, positioning, arrows} +\usepackage{environ} + diff --git a/util/tikz.tex b/util/tikz.tex new file mode 100644 index 0000000..85cdc62 --- /dev/null +++ b/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} +}