Creé el siguiente árbol de juego: Aquí está mi código:
\documentclass[leqno, oneside, 12pt]{book}
\usepackage{amsmath}
\usepackage{istgame}
\usepackage{caption}
\usepackage{makecell}
\begin{document}
\begin{figure}[ht]
\centering
\begin{istgame}[font=\footnotesize]
\xtdistance{30mm}{90mm}
\setxtinfosetstyle{dashed}
\xtShowEndPoints
\istroot[right](0)<above>{0}
\istbA{0.95}[above,sloped]
\istbA{0.05}[above,sloped]
\endist
\xtdistance{30mm}{30mm}
\istroot[right](1)(0-2)<above>{1.1}
\istbA{g_1\quad(\beta)}[above,sloped]
\istbA{f_1\quad(1-\beta)}[above,sloped]{0,0}
\endist
\xtOwner(1){\makecell{$\langle\alpha\rangle$}}[below]
\istroot[right](2)(0-1)<above>{1.1}
\istbA(2){g_1\quad(\beta)}[above,sloped]
\istbA{f_1\quad(1-\beta)}[above,sloped]{0,0}
\endist
\xtOwner(2){\makecell{$\langle1-\alpha\rangle$}}[below]
\istroot[right](3)(1-1)<above>{2.2}
\istbA{g_2\quad(\gamma)}[above,sloped]
\istbA{f_2\quad(1-\gamma)}[above,sloped]{-1,5}
\endist
\xtOwner(3){\makecell{$\langle1\rangle$}}[below]
\istroot[right](4)(3-1)<above>{1.3}
\istbA{g_3\quad(\epsilon)}[above,sloped]
\istbA{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\endist
\xtOwner(4){\makecell{$\langle\delta\rangle$}}[below]
\istroot[right](5)(2-1)<above>{1.3}
\istbA(2){g_3\quad(\epsilon)}[above,sloped]{8,8}
\istbA{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\endist
\xtOwner(5){\makecell{$\langle1-\delta\rangle$}}[below]
\istroot[right](6)(4-1)<above>{2.4}
\istbA{g_4\quad(\zeta)}[above,sloped]{8,8}
\istbA{f_4\quad(1-\zeta)}[above,sloped]{3,9}
\endist
\xtOwner(6){\makecell{$\langle1\rangle$}}[below]
\xtInfosetO(1)(2)(1.2cm)
\xtInfosetO(3)(3)(1.2cm)
\xtInfosetO(4)(5)(1.2cm)
\xtInfosetO(6)(6)(1.2cm)
\end{istgame}
\caption{}
\end{figure}
\end{document}
Quiero que cada rama ascendente sea paralela entre sí y cada rama descendente también sea paralela. (Como puede ver, en este momento las líneas descendentes no son paralelas). Mientras tanto, los dos nodos 1.1 deben estar alineados y los dos nodos 1.3 también deben estar alineados. ¿Cómo debería hacer eso? ¡Realmente aprecio cualquier ayuda!
Respuesta1
No estoy muy familiarizado con este paquete, pero revisé la documentación y no parece haber una manera de especificar el ángulo de la alternativa (o arco) \istbA
; sólo existe, como usted lo ha hecho, una manera de especificar la propagación de los niños.
Para fines de diagnóstico, hice el siguiente diagrama:
\documentclass[tikz,margin=10pt]{standalone}
\usepackage{istgame}
\usepackage{makecell}
\begin{document}
\begin{istgame}
\xtdistance{30mm}{90mm}
\setxtinfosetstyle{dashed}
\xtShowEndPoints
\setistgrowdirection'{east}
\istroot(0)<above>{0}
\istbA{to:0-1}[above,sloped]
\istbA{to:0-2}[above,sloped]
\endist
\xtdistance{30mm}{30mm}
\istroot(1)(0-1)<above>{1}
\istbA{to:1-1}[above,sloped]{end}
\istbA{to:1-2}[above,sloped]
\endist
\xtOwner(1){\makecell{1label}}[below]
\istroot(2)(0-2)<above>{2}
\istbA{to:2-1}[above,sloped]{end}
\istbA(2){to:2-2}[above,sloped]
\endist
\xtOwner(2){\makecell{2label}}[below]
\istroot(3)(1-2)<above>{3}
\istbA{to:3-1}[above,sloped]{end}
\istbA{to:3-2}[above,sloped]
\endist
\xtOwner(3){\makecell{3label}}[below]
\istroot(4)(3-2)<above>{4}
\istbA{to:4-1}[above,sloped]{end}
\istbA{to:4-2}[above,sloped]
\endist
\xtOwner(4){\makecell{4label}}[below]
\istroot(5)(2-2)<above>{5}
\istbA{to:5-1}[above,sloped]{end}
\istbA(2){to:5-2}[above,sloped]{end}
\endist
\xtOwner(5){\makecell{5label}}[below]
\istroot(6)(4-2)<above>{6}
\istbA{to:6-1}[above,sloped]{end}
\istbA{to:6-2}[above,sloped]{end}
\endist
\xtOwner(6){\makecell{6label}}[below]
\xtInfosetO(1)(2)(1.2cm)
\xtInfosetO(3)(3)(1.2cm)
\xtInfosetO(4)(5)(1.2cm)
\xtInfosetO(6)(6)(1.2cm)
\end{istgame}
\end{document}
Hay una manera de agregar niños "faltantes", usando \istb<missing>
o \istbm
para abreviar. Desafortunadamente, es difícil saber cómo se calcula el ángulo \istbA(<level>)
, por lo que intentar alinear la fila inferior agregando estos niños faltantes resultó ser demasiado tedioso incluso con este modelo simplificado.
En cambio, si estás dispuesto a comprometer la simetría, te ofrezco esta solución:
\documentclass[tikz,margin=10pt]{standalone}
\usepackage{istgame}
\usepackage{makecell}
\begin{document}
\begin{istgame}
\xtdistance{30mm}{60mm}
\setxtinfosetstyle{dashed}
\xtShowEndPoints
\setistgrowdirection'{east}
\istroot(0)<above>{0}
\istbA{to:0-1}[above,sloped]
\istbA{to:0-2}[above,sloped]
\endist
\xtdistance{30mm}{30mm}
\istroot(1)(0-1)<above>{1}
\istbA{to:1-1}[above,sloped]{end}
\istbA{to:1-2}[above,sloped]
\istbm
\endist
\xtOwner(1){\makecell{1label}}[below]
\istroot(2)(0-2)<above>{2}
\istbA{to:2-1}[above,sloped]{end}
\istbA(2){to:2-2}[above,sloped]
\istbm
\endist
\xtOwner(2){\makecell{2label}}[below]
\istroot(3)(1-2)<above>{3}
\istbA{to:3-1}[above,sloped]{end}
\istbA{to:3-2}[above,sloped]
\istbm
\endist
\xtOwner(3){\makecell{3label}}[below]
\istroot(4)(3-2)<above>{4}
\istbA{to:4-1}[above,sloped]{end}
\istbA{to:4-2}[above,sloped]
\istbm
\endist
\xtOwner(4){\makecell{4label}}[below]
\istroot(5)(2-2)<above>{5}
\istbA{to:5-1}[above,sloped]{end}
\istbA(2){to:5-2}[above,sloped]{end}
\istbm
\endist
\xtOwner(5){\makecell{5label}}[below]
\istroot(6)(4-2)<above>{6}
\istbA{to:6-1}[above,sloped]{end}
\istbA{to:6-2}[above,sloped]{end}
\istbm
\endist
\xtOwner(6){\makecell{6label}}[below]
\xtInfosetO(1)(2)(1.2cm)
\xtInfosetO(3)(3)(1.2cm)
\xtInfosetO(4)(5)(1.2cm)
\xtInfosetO(6)(6)(1.2cm)
\end{istgame}
\end{document}
Que, cuando se completa, parece
Nuevamente, esto no es lo ideal, pero si su objetivo es paralelo a toda costa, esto será suficiente. Recomiendo agregar [scale=1.2]
o similar para \begin{istgame}
escalar, pero esa es una preferencia personal. En el MWE a continuación, notarás que eliminé las [right]
etiquetas y las agregué \setistgrowdirection'{east}
en su lugar, lo que mantiene los nodos organizados de arriba a abajo de manera sensata en el código, al menos en mi opinión.
¡Ojalá esto ayude un poco!
MWE:
\documentclass[tikz,margin=10pt]{standalone}
\usepackage{istgame}
\usepackage{makecell}
\begin{document}
\begin{istgame}
\xtdistance{30mm}{60mm}
\setxtinfosetstyle{dashed}
\xtShowEndPoints
\setistgrowdirection'{east}
\istroot(0)<above>{0}
\istbA{0.05}[above,sloped]
\istbA{0.95}[above,sloped]
\endist
\xtdistance{30mm}{30mm}
\istroot(1)(0-1)<above>{1.1}
\istbA{f_1\quad(1-\beta)}[above,sloped]{0,0}
\istbA{g_1\quad(\beta)}[above,sloped]
\istbm
\endist
\xtOwner(1){\makecell{$\langle\alpha\rangle$}}[below]
\istroot(2)(0-2)<above>{1.1}
\istbA{f_1\quad(1-\beta)}[above,sloped]{0,0}
\istbA(2){g_1\quad(\beta)}[above,sloped]
\istbm
\endist
\xtOwner(2){\makecell{$\langle1-\alpha\rangle$}}[below]
\istroot(3)(1-2)<above>{2.2}
\istbA{f_2\quad(1-\gamma)}[above,sloped]{-1,5}
\istbA{g_2\quad(\gamma)}[above,sloped]
\istbm
\endist
\xtOwner(3){\makecell{$\langle1\rangle$}}[below]
\istroot(4)(3-2)<above>{1.3}
\istbA{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\istbA{g_3\quad(\epsilon)}[above,sloped]
\istbm
\endist
\xtOwner(4){\makecell{$\langle\delta\rangle$}}[below]
\istroot(5)(2-2)<above>{1.3}
\istbA{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\istbA(2){g_3\quad(\epsilon)}[above,sloped]{8,8}
\istbm
\endist
\xtOwner(5){\makecell{$\langle1-\delta\rangle$}}[below]
\istroot(6)(4-2)<above>{2.4}
\istbA{f_4\quad(1-\zeta)}[above,sloped]{3,9}
\istbA{g_4\quad(\zeta)}[above,sloped]{8,8}
\istbm
\endist
\xtOwner(6){\makecell{$\langle1\rangle$}}[below]
\xtInfosetO(1)(2)(1.2cm)
\xtInfosetO(3)(3)(1.2cm)
\xtInfosetO(4)(5)(1.2cm)
\xtInfosetO(6)(6)(1.2cm)
\end{istgame}
\end{document}
Respuesta2
Me gustaría usar \istb
en lugar de usar \istbA
.
Es posible que desee reemplazar \istbA(2)
con
\istbA(2)<grow=-27,level distance=67mm>
o simplemente para usar
\istb<grow=-27,level distance=67mm>
.
Este cambio dará el resultado (aproximado) que desea.
\documentclass[leqno, oneside, 12pt]{book}
\usepackage{amsmath}
\usepackage{istgame}
\usepackage{caption}
\usepackage{makecell}
\begin{document}
\begin{figure}[ht]
\centering
\begin{istgame}[font=\footnotesize]
%%% some calculation:
\pgfmathparse{90-atan(30/15)}
\node(0,0)[draw,yshift=10mm]{\pgfmathresult};
\pgfmathparse{sqrt(30^2+15^2)}
\node(0,0)[draw,yshift=15mm]{\pgfmathresult};
%%% tree direction
\setistgrowdirection{east} %%% instead of using [right] in \istroot
%\setistgrowdirection'{east} %%% (swap version) looks more convenient
%%% \istb (instead of \istbA)
\xtdistance{30mm}{90mm}
\setxtinfosetstyle{dashed}
\xtShowEndPoints
\istroot(0)<above>{0}
\istb{0.95}[above,sloped]
\istb{0.05}[above,sloped]
\endist
\xtdistance{30mm}{30mm}
\istroot(1)(0-2)<above>{1.1}
\istb{g_1\quad(\beta)}[above,sloped]
\istb{f_1\quad(1-\beta)}[above,sloped]{0,0}
\endist
\xtOwner(1){\makecell{$\langle\alpha\rangle$}}[below]
\istroot(2)(0-1)<above>{1.1}
\istb<grow=-27,level distance=67mm>[blue,thick] %%% CHANGED
{g_1\quad(\beta)}[above,sloped]
\istb{f_1\quad(1-\beta)}[above,sloped]{0,0}
\endist
\xtOwner(2){\makecell{$\langle1-\alpha\rangle$}}[below]
\istroot(3)(1-1)<above>{2.2}
\istb{g_2\quad(\gamma)}[above,sloped]
\istb{f_2\quad(1-\gamma)}[above,sloped]{-1,5}
\endist
\xtOwner(3){\makecell{$\langle1\rangle$}}[below]
\istroot(4)(3-1)<above>{1.3}
\istb{g_3\quad(\epsilon)}[above,sloped]
\istb{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\endist
\xtOwner(4){\makecell{$\langle\delta\rangle$}}[below]
\istroot(5)(2-1)<above>{1.3}
\istb<grow=-27,level distance=67mm>[blue,thick] %%% CHANGED
{g_3\quad(\epsilon)}[above,sloped]{8,8}
\istb{f_3\quad(1-\epsilon)}[above,sloped]{4,4}
\endist
\xtOwner(5){\makecell{$\langle1-\delta\rangle$}}[below]
\istroot(6)(4-1)<above>{2.4}
\istb{g_4\quad(\zeta)}[above,sloped]{8,8}
\istb{f_4\quad(1-\zeta)}[above,sloped]{3,9}
\endist
\xtOwner(6){\makecell{$\langle1\rangle$}}[below]
\xtInfosetO(1)(2)(1.2cm)
\xtInfosetO(3)(3)(1.2cm)
\xtInfosetO(4)(5)(1.2cm)
\xtInfosetO(6)(6)(1.2cm)
\end{istgame}
\caption{}
\end{figure}
\end{document}