我正在使用此代码,但想获得 4 个额外级别,可以吗?
\begin{tikzpicture}[scale=1.5,font=\footnotesize]
% Specify spacing for each level of the tree
\tikzstyle{level 1}=[level distance=12mm,sibling distance=18mm]
\tikzstyle{level 2}=[level distance=15mm,sibling distance=15mm]
\tikzstyle{level 3}=[level distance=12mm,sibling distance=18mm]
\tikzstyle{level 4}=[level distance=15mm,sibling distance=15mm]
% The Tree
\node(0)[solid node,label=above:{$P1$}]{}
child{node(1)[solid node, white]{}
}
child{[white] node(2)[solid node, yshift=-22]{} %note that you need to adjust the yshift if you change the sibling distance
child{[black] node[hollow node,label=below:{$(a,b)$}]{} edge from parent node[left]{$C$}}
child{[black] node[hollow node,label=below:{$(c,d)$}]{} edge from parent node[right]{$D$}}
edge from parent node[black, xshift=0,yshift=-42]{$\alpha$} %note that you need to adjust the yshift if you change the level distance
}
child{node(3)[solid node, white]{}
}
;
% information set
\draw[solid,bend right](1)to(3);
\end{tikzpicture}
答案1
使用游戏包中,你可以这样做:
\documentclass{standalone}
\usepackage{istgame}
\begin{document}
\begin{istgame}[scale=1.5,font=\footnotesize]
\xtShowEndPoints
\cntmdistance{12mm}{30mm}
\xtdistance{12mm}{15mm}
% period 1
\cntmAistb{0}[at end,left]{1}[at end,right]
\istrootcntmA(1){Player 1}
\istbA[draw=none]{s_1}[very near end]
\endist
\istroot(1a)(1-1)
\istb{Accept}[al]{(s_1,1-s_1)}
\istb{Reject}[ar]
\endist
% period 2
\cntmAistb{0}[at end,left]{1}[at end,right]
\istrootcntmA(2)(1a-2)<0>{Player 2}
\istbA[draw=none]{s_2}[very near end]
\endist
\istroot(2a)(2-1)
\istb{Accept}[al]{(\delta s_2,\delta(1-s_2))}
\istb{Reject}[ar]
\endist
% period 3
\cntmAistb{0}[at end,left]{1}[at end,right]
\istrootcntmA(3)(2a-2)<0>{Player 1}
\istbA[draw=none]{s_3}[very near end]
\endist
\istroot(3a)(3-1)
\istb{Accept}[al]{(\delta^2s_3,\delta^2(1-s_3))}
\istb{Reject}[ar]
\endist
% period 4
\cntmAistb{0}[at end,left]{1}[at end,right]
\istrootcntmA(4)(3a-2)<0>{Player 2}
\istbA[draw=none]{s_4}[very near end]
\endist
\istroot(4a)(4-1)
\istb{Accept}[al]{(\delta^3s_4,\delta^3(1-s_4))}
\istb{Reject}[ar]{\vdots}
\endist
\end{istgame}
\end{document}