Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/tikz/decision_tree_oil_wildcatter_tikz.tex
1191 views
1
\documentclass[tikz, border=2pt]{standalone}
2
\usepackage[utf8]{inputenc}
3
\usepackage{tikz}
4
\usetikzlibrary{shapes.geometric}
5
\usetikzlibrary{positioning}
6
\newcommand{\specific}{rgb:orange,1;yellow,2;pink,5}
7
% \title{Decision_tree_oil_wildcatter_problem}
8
% \author{Vishal Ghoniya}
9
% \date{July 2022}
10
11
\begin{document}
12
\tikzstyle{chance variable}=[circle, draw=black, minimum size=3mm]
13
\tikzstyle{decision node}=[rectangle, draw=black, minimum height=4mm, minimum width=2cm]
14
\tikzstyle{decision}=[rectangle, draw=black, minimum height=4mm, minimum width=4mm]
15
\tikzstyle{higher utility}=[diamond, draw=black, fill=green, minimum width=3mm, minimum height=3mm]
16
\tikzstyle{lower utility}=[diamond, draw=black, fill=red, minimum width=3mm, minimum height=3mm]
17
\begin{tikzpicture}[font={\small}]
18
19
\node [chance variable, fill=black] at (0,0) (root) {};
20
21
\node[chance variable, fill=\specific, right=2cm of root] (s_1) {S = 1} edge (root);
22
\node[above right=0.2cm of s_1, yshift=-0.5cm] {0.35};
23
\node[decision, fill=black, right=1cm of s_1] (d_1) {} edge (s_1);
24
\node[decision node, fill=\specific, above right=0.75cm of d_1] (dd_1) {Drill} (dd_1.west) edge[-] (d_1.north);
25
\node[decision node, fill=\specific, below right=0.75cm of d_1] (ddn_1) {Don't Drill} (ddn_1.west) edge[-] (d_1.south);
26
\node [higher utility, right=2cm of dd_1] (u_1) {} edge (dd_1);
27
\node [right=0.3cm of u_1] {32.9};
28
\node [lower utility, right=2cm of ddn_1] (un_1) {} edge (ddn_1);
29
\node [right=0.3cm of un_1] {0};
30
31
32
\node[chance variable, fill=\specific, above=2cm of s_1] (s_0) {S = 0} edge (root);
33
\node[above right=0.2cm of s_0, yshift=-0.5cm] {0.41};
34
\node[decision, fill=black, right=1cm of s_0] (d_0) {} edge (s_0);
35
\node[decision node, fill=\specific, above right=0.75cm of d_0] (dd_0) {Drill} (dd_0.west) edge[-] (d_0.north);
36
\node[decision node, fill=\specific, below right=0.75cm of d_0] (ddn_0) {Don't Drill} (ddn_0.west) edge[-] (d_0.south);
37
\node [lower utility, right=2cm of dd_0] (u_0) {} edge (dd_0);
38
\node [right=0.3cm of u_0] {-30.5};
39
\node [higher utility, right=2cm of ddn_0] (un_0) {} edge (ddn_0);
40
\node [right=0.3cm of un_0] {0};
41
42
\node[chance variable, fill=\specific, below=2cm of s_1] (s_2) {S = 2} edge (root);
43
\node[above right=0.2cm of s_2, yshift=-0.5cm] {0.24};
44
\node[decision, fill=black, right=1cm of s_2] (d_2) {} edge (s_2);
45
\node[decision node, fill=\specific, above right=0.75cm of d_2] (dd_2) {Drill} (dd_2.west) edge[-] (d_2.north);
46
\node[decision node, fill=\specific, below right=0.75cm of d_2] (ddn_2) {Don't Drill} (ddn_2.west) edge[-] (d_2.south);
47
\node [higher utility, right=2cm of dd_2] (u_2) {} edge (dd_2);
48
\node [right=0.3cm of u_2] {87.5};
49
\node [lower utility, right=2cm of ddn_2] (un_2) {} edge (ddn_2);
50
\node [right=0.3cm of un_2] {0};
51
52
53
\end{tikzpicture}
54
55
\end{document}
56
57