这是一个后续问题这。
代码:
\documentclass[12pt]{article}
\usepackage{istgame}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta, positioning}
\begin{document}
\begin{center}
\begin{istgame}
\setistNewNodeStyle{max}
[regular polygon, regular polygon sides = 3]{1.5cm}
\setistNewNodeStyle{min}
[regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.5cm}
\setistNewNodeStyle{chance}
[circle]{1.2cm}
%\xtShowTerminalNodes[box node, minimum size = 1cm]
\def\distFactor{20};
\xtdistance{\distFactor mm}{4*\distFactor mm}
\setxtarrowtips[blue, thick]
\istroot(0)[max]<center, blue>{1.5}
\istb[blue, ->-] \istb \endist
\xtdistance{\distFactor mm}{2*\distFactor mm}
\istroot(1)(0-1)[chance]<center, purple>{1.5}
\istb{0.5}[al] \istb{0.5}[ar] \endist
\istroot(2)(0-2)[chance]<center, purple>{$\leq 1$}
\istb{0.5}[al] \istb{0.5}[ar] \endist
\xtdistance{\distFactor mm}{\distFactor mm}
\istroot(3)(1-1)[min]<center, red>{2}
\istb{}{2} \istb{}{5000}[[circle, draw, yshift = 2pt, minimum size = 0.75cm] below] \endist
\istroot(4)(1-2)[min]<center, red>{1}
\istb{}{1} \istb{}{100}[[circle, draw, yshift = 2pt, minimum size = 0.75cm] below] \endist
\istroot(5)(2-1)[min]<center, red>{0}
\istb{}{0} \istb{}{2}[[circle, draw, yshift = 2pt, minimum size = 0.75cm] below] \endist
\istroot(6)(2-2)[min]
\istb{}{-1}[[circle, draw, yshift = 2pt, minimum size = 0.75cm] below] \istb{}{0}[[circle, draw, yshift = 2pt, minimum size = 0.75cm] below] \endist
\end{istgame}
\end{center}
\end{document}
输出:
minimum size
是解决方案的一部分,但是有没有办法将终端值与最大圆内的值对齐?(请注意,为了获得此输出,终端值列出不正确)
答案1
其中一种方法是使用\xtShowEndPoints
后跟xtShowTerminalNodes
:
\documentclass[12pt,border=2pt]{standalone}
\usepackage{istgame}
%\usepackage{tikz}
%\usetikzlibrary{shapes,arrows.meta, positioning}
\begin{document}
\begin{istgame}
\setistNewNodeStyle{max}
[regular polygon, regular polygon sides = 3]{1.5cm}
\setistNewNodeStyle{min}
[regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.5cm}
\setistNewNodeStyle{chance}
[circle]{1.2cm}
\def\distFactor{20};
\xtdistance{\distFactor mm}{4*\distFactor mm}
\setxtarrowtips[blue, thick]
\istroot(0)[max]<center, blue>{1.5}
\istb[blue, ->-]
\istb
\endist
\xtdistance{\distFactor mm}{2*\distFactor mm}
\istroot(1)(0-1)[chance]<center, purple>{1.5}
\istb{0.5}[al]
\istb{0.5}[ar]
\endist
\istroot(2)(0-2)[chance]<center, purple>{$\leq 1$}
\istb{0.5}[al]
\istb{0.5}[ar]
\endist
%% terminal nodes with or without circles (TRICK!!)
\xtShowEndPoints[circle,draw,minimum size=1.1cm] % comes before \xtShowTerminalNodes
\xtShowTerminalNodes[circle,draw=none,minimum size=1.1cm]
\xtdistance{\distFactor mm}{\distFactor mm}
\istroot(3)(1-1)[min]<center, red>{2}
\istbt{}{2}[center] %
\istb{}{5000}[center]
\endist
\istroot(4)(1-2)[min]<center, red>{1}
\istbt{}{1}[center] %
\istb{}{100}[center]
\endist
\istroot(5)(2-1)[min]<center, red>{0}
\istbt{}{0}[center] %
\istb{}{2}[center]
\endist
\istroot(6)(2-2)[min]
\istb{}{-1}[center]
\istb{}{0}[center]
\endist
\end{istgame}
\end{document}