我想用 LaTeX 绘制以下游戏树,希望istgame
如此,因为我正在用它绘制其他图形。使用诸如顶部两个圆圈之类的图形绘制扇区没有问题istgame
(我实际上用 LaTeX 绘制了三角形,但对我来说两者都可以)。但是,对于最后一个扇区,从节点开始,我有一个连续的分支加上一个(或多个)单独的分支,我无法让它工作。这是目标树
这是我尝试过的 LaTeX
\documentclass{article}
\usepackage{istgame}
\begin{document}
\begin{istgame}
\xtdistance{15mm}{25mm}
\istroot(1){S}
\istb{a_1}[r] \istbm
\endist
\xtdistance{15mm}{25mm}
\istroot(3)(1-1){B}
\istb{A}[al]{u_1}
\endist
\istrootcntm(4)(1-1){B}
\istb{a_2}[r] \istbm
\endist
\end{istgame}
\end{document}
有这个关于 tex.se 的问题使用以下代码,但是它只是设置了一个“随机”(通过反复试验)的增长方向,我可以自动执行此操作吗?
\documentclass{article}
\usepackage{istgame}
\begin{document}
\begin{istgame}
\cntmdistance*{20mm}{20mm}
\istroot(0)
\istb*<grow=-135>{r}[above]
\endist
\cntmAistb{0}[left,near end]{1}[right,near end]
\cntmApreset{.7}
\istrootcntmA(0)
\istbA*(1.5){}{a}
\endist
\end{istgame}
\end{document}
答案1
树结构:
\documentclass{standalone}
\usepackage{istgame}
\begin{document}
\begin{istgame}[font=\scriptsize]
\xtdistance{15mm}{60mm}
\istroot(0)[chance node]{N}
\istb \istb \endist
\xtInfoset(0-1)(0-2)
\cntmdistance*{15mm}{25mm}
%% left part
\istrootcntm(1a)(0-1)
\istb \istbm \endist
\istrootcntm(2a)(1a-1)
\istb \istbm \endist
% additional branch
\xtdistance{15mm}{60mm}
\istroot(2aA)(2a)
\istb \istbm \endist
% back to main
\cntmdistance*{15mm}{25mm}
\istroot(3a)(2a-1)
\istb \istb \endist
%% right part
\istrootcntm(1b)(0-2)
\istb \istbm \endist
\istroot(2b)(1b-1)
\istb \istb \endist
\end{istgame}
\end{document}
完整代码:
\documentclass{standalone}
\usepackage{istgame}
\begin{document}
\begin{istgame}[font=\scriptsize]
\xtdistance{15mm}{60mm}
\istroot(0)[chance node]{N}
\istB{\mbox{negotiator}}[al]{p}[br]
\istB{\mbox{non-negotiator}}[ar]{1-p}[bl]
\endist
\xtInfoset(0-1)(0-2)
\cntmdistance*{15mm}{25mm}
%% left part
\cntmistb{s}[below left,at end]{\infty}[below right,at end]
\istrootcntm(1a)(0-1)
\istb{a_1}[above right,at end] \istbm
\endist
\cntmistb{0}[below left,at end]{\infty}[below right,at end]
\istrootcntm(2a)(1a-1)
\istb{a_2}[above right,at end] \istbm
\endist
% additional branch
\xtdistance{15mm}{60mm}
\istroot(2aA)(2a)
\istb{A}[al]{(a_1-s,b-a_1)} \istbm
\endist
% back to main
\cntmdistance*{15mm}{25mm}
\istroot(3a)(2a-1)
\istb{A}[al]{(a_2-s,b-a_1d(a_1-a_2))}
\istb{D}[ar]{(0,0)}
\endist
%% right part
\cntmistb{0}[below left,at end]{\infty}[below right,at end]
\istrootcntm(1b)(0-2)
\istb{a_1}[above right,at end] \istbm
\endist
\istroot(2b)(1b-1)
\istb{A}[al]{(a_1-s,b-a_1)}
\istb{B}[ar]{(0,0)}
\endist
%% more text
\xtTimeLineH[draw=none](1b){0}{6}{S}
\xtTimeLineH[draw=none](2b){0}{6}{B}
\xtTimeLineH[draw=none](3a){0}{6}{S}
\end{istgame}
\end{document}