我做错了什么,无法用 psmatrix 显示序列?

我做错了什么,无法用 psmatrix 显示序列?

不要在代码的最后几行出现这些行来显示序列!!1

(根据 Crishtopher 的建议/评论进行编辑)

我想要的是(红色标记): 在此处输入图片描述


\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,latexsym}

\usepackage{pst-node}
\usepackage{pst-blur}


%\input{pssettings.tex}
\begin{document}
\psset{framearc=0.2,shadowcolor=black!70,shadowangle=-90}‎
\begin{psmatrix}[rowsep=2.9cm,colsep=0.5]% defines the distance between two frames
    &
    \psframe[fillcolor=lightgray,linestyle=none,blur,shadow](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \rput(0,-1.35){Solución Actual}
    \\
       &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.55,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
    \rput(0,-1.35){Generar Vecindad}
    \\

    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linecolor=red,linewidth=0.09,opacity=0.3]{-}(0.40,0.40)(0.90,-0.10)
    \psline[linecolor=red,linewidth=0.09,opacity=0.3]{-}(0.40,-0.10)(0.90,0.40)

    %\psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
     &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=blue](0,0){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0,0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.75,0.75){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,0.15){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnode[fillstyle=solid,fillcolor=pink](-0.75,-0.55){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](-0.05,-0.5){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.65,-0.65){0.15}{Current}
    \cnode[fillstyle=solid,fillcolor=pink](0.35,-0.40){0.15}{Current}
    \rput(0,-1.35){Elegir el Mejor Vecino}
    \\

\psdiabox[shadow=true,framesep=0.1]{\tabular{c}Criterio de\\ Aspiración\endtabular}
    &\psdiabox[shadow=true]{\tabular{c}Está en\\ Lista Tabú?\endtabular}\\
    &
    \psframe[fillcolor=lightgray,linestyle=none,shadow,blur](-1.00,-1.00)(1.00,1.00)
    \cnode[fillstyle=solid,fillcolor=green](0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \rput(0,-1.35){\tabular{c}Aceptarla como nueva solución\\y comenzar de nuevo el proceso\endtabular}
    \\


       %Links
 %   \ncline{->}{1,2}{2,2}
  % \ncline{->}{3,2}{4,2}
   % \ncline{->}{4,2}{5,2}^{\textcolor{red}{No}}
%    \ncline{->}{4,2}{5,1}<{\textcolor{red}{Si}}
 %   \ncline{->}{4,1}{5,2}<{\textcolor{red}{Si}}
  %  \ncline{->}{4,1}{4,1}<{\textcolor{red}{No}}
\end{psmatrix}

\end{document} 

我认为在完成这个图表之后,我会回到铅笔和纸上:-)) 它非常复杂,如果您不是专家,也可以达到您想要的效果!!

答案1

问题是,最初您有空行(由于某些原因\\~),并且您忘记了这些行仍然已编号。因此有必要为实际节点命名。

无论如何,这里有两种解决方案,使用(部分)\ovalframe框。我给出了两种代码,它们本质上是相同的,只是参数/设置和命令有所不同。

带椭圆形盒子:

  \documentclass[10pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[textwidth = 18cm, textheight = 25cm]{geometry}

\usepackage{mathtools,amsfonts,amssymb,latexsym}

\usepackage{graphicx}

\newcommand*{\upstrut}[1]{\rule{0pt}{#1}}% creates an invisible rule of height #1
\newcommand*{\negstrut}[1]{\rule[-#1]{0pt}{#1}}% creates an invisible rule of deptht #1

\usepackage{pstricks}%[pdf]
\usepackage{pst-node}
\usepackage{pst-blur}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\pagestyle{empty}
\begin{document}
%\resizebox{18cm}{!}{    % if you want to resize


\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm}
\def\pscolhookiii{\psset[pst-node]{mcol = l}}


\begin{psmatrix}[rowsep=2.2, colsep=-1.25]% defines the distance between two frames
%
 & [name = SA]
  \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \rput[t](0,-1.25){Solución Actual}&
    \\[1.25cm]
%
    & [name=GV]
    \psframegray(-1.00,-1.00)(1.00,1.00)%
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.55,0.15){0.15}{Current}
    \cnodepink(0.65,0.15){0.15}{Current}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Generar Vecindad}
    \\[0.25cm]
    %~\\
   & [mnode = dia, shadow=true, linearc = 0.05,framesep=0.1,name = Vvacia]%
    \rule{0.8cm}{0pt}\clap{\begin{tabular}{c}¿Vecindad=$∅$?\end{tabular}}\rule[-0.21cm]{0pt}{0.6cm}\rule{0.8cm}{0pt}%{}\psdiamond(1.6,1.4)
   & [mnode = oval, shadow=true, linearc = 0.05,framesep=-0.22,name = Vfin]
    \begin{tabular}{@{}c@{\hskip\itemsep}l@{}}\textbullet &\upstrut{4ex} Finalizar \\ \textbullet & Eligir Mejor\\ &Solución Visitada\negstrut{3ex} \end{tabular}
    \\[-0.35cm]
%
  [name=Wr]
   \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \psset{linecolor=red,linewidth=0.09,opacity=0.3}
    \psline(0.40,0.40)(0.90,-0.10)
    \psline(0.40,-0.10)(0.90,0.40)
    \rput[t](0,-1.25){Eliminar Vecino Elegido}
%
     & [name=EMV]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Elegir Mejor Vecino}
    &
    \\[0.5cm]
%
    [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = CA]
    \begin{tabular}{c}¿Verifica\\Criterio de\\Aspiración?\end{tabular}
        & [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = LT]
    \rule{1cm}{0pt}\clap{\begin{tabular}{c}¿Está en\\Lista Tabú? \end{tabular}}\rule[-0.45cm]{0pt}{1cm}\rule{1cm}{0pt}
    \\
%
    & [name=Ace, mnode = r]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
     &
    \\
%
    &    [mnode = oval, shadow=true, linearc = 0.05,framesep=-0.22,name = Repetir]
    \begin{tabular}{@{}c@{\hskip\itemsep}p{7cm}@{}} %>{}
     \textbullet\upstrut{4ex} & Actualizar Lista Tabú\\
     \textbullet & Aceptar Vecino Elegido como nueva solución\\
     \textbullet & Repetir proceso hasta alcanzar el máximo de iteraciones.\\
      \textbullet & Si se han agotado la iteraciones, tomar como Solución, la mejor de todas las visitadas \negstrut{2ex}
     \end{tabular}
%}%
\end{psmatrix}
%%% Links
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos=0.45}
\ncline{LT}{CA}_{Si}
{\psset{nodesepB = 1.20}%
 \ncline[nodesepA = 1.65cm]{SA}{GV}%
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{Vvacia}{EMV}^{No}
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{LT}{Ace}^{No}%
 \ncline[nodesepB = 1.65cm]{CA}{Wr}^{No}
 \ncangle[nodesepA = 7pt, angleA = -90]{CA}{Ace}\nbput{Si}}%
 \ncline[nodesepA = 1.67cm]{EMV}{LT}%
 \ncline[nodesepA = 1.65cm]{GV}{Vvacia}
 \ncangle[nodesepA = 1.25, angleA = 90]{Wr}{Vvacia}
 \ncline{Vvacia}{Vfin}^{Si} %[nodesepA = 0.1cm]
 \ncline[nodesepA = 1.25cm]{Ace}{Repetir}
%}

\end{document}   

在此处输入图片描述

带框架盒:

\documentclass[10pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[textwidth = 18cm, textheight = 25cm]{geometry}

\usepackage{mathtools,amsfonts,amssymb,latexsym}

\usepackage{graphicx}

\newcommand*{\upstrut}[1]{\rule{0pt}{#1}}% creates an invisible rule of height #1
\newcommand*{\negstrut}[1]{\rule[-#1]{0pt}{#1}}% creates an invisible rule of deptht #1

\usepackage{pstricks}%[pdf]
\usepackage{pst-node}
\usepackage{pst-blur}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\pagestyle{empty}
\begin{document}
%\resizebox{18cm}{!}{    % if you want to resize


\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm}
\def\pscolhookiii{\psset[pst-node]{mcol = l}}


\begin{psmatrix}[rowsep=2.2, colsep=-0.8]% defines the distance between two frames
%
 & [name = SA]
  \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \rput[t](0,-1.25){Solución Actual}&
    \\[1.25cm]
%
    & [name=GV]
    \psframegray(-1.00,-1.00)(1.00,1.00)%
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.55,0.15){0.15}{Current}
    \cnodepink(0.65,0.15){0.15}{Current}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Generar Vecindad}
    \\[0.5cm]
%
   & [mnode = dia, shadow=true, linearc = 0.05,framesep=0.1,name = Vvacia]%
    \rule{0.8cm}{0pt}\clap{\begin{tabular}{c}¿Vecindad=$∅$?\end{tabular}}\rule[-0.21cm]{0pt}{0.6cm}\rule{0.8cm}{0pt}%{}\psdiamond(1.6,1.4)
   & [mnode = r, name = Vfin]
    \psframebox[shadow=true, framearc = 0.15]{\begin{tabular}{c@{\hskip\itemsep}l}
    \textbullet & Finalizar \\ \textbullet & Eligir Mejor\\ &Solución Visitada
    \end{tabular}}
    \\
%
  [name=Wr]
   \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \psset{linecolor=red,linewidth=0.09,opacity=0.3}
    \psline(0.40,0.40)(0.90,-0.10)
    \psline(0.40,-0.10)(0.90,0.40)
    \rput[t](0,-1.25){Eliminar Vecino Elegido}
%
     & [name=EMV]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodeblue(0,0){0.15}{Current}
    \cnodepink(-0.75,0.75){0.15}{Current}
    \cnodepink(0,0.65){0.15}{Current}
    \cnodepink(0.75,0.75){0.15}{Current}
    \cnodepink(-0.75,0.15){0.15}{Current}
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
    \cnodepink(-0.75,-0.55){0.15}{Current}
    \cnodepink(-0.05,-0.5){0.15}{Current}
    \cnodepink(0.65,-0.65){0.15}{Current}
    \cnodepink(0.35,-0.40){0.15}{Current}
    \rput[t](0,-1.25){Elegir Mejor Vecino}
    &
    \\[0.5cm]
%
    [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = CA]
    \begin{tabular}{c}¿Verifica\\Criterio de\\Aspiración?\end{tabular}
        & [mnode = dia, shadow=true, linearc = 0.05,framesep=-0.2,name = LT]
    \rule{1cm}{0pt}\clap{\begin{tabular}{c}¿Está en\\Lista Tabú? \end{tabular}}\rule[-0.45cm]{0pt}{1cm}\rule{1cm}{0pt}
    \\
%
    & [name=Ace, mnode = r]
    \psframegray(-1.00,-1.00)(1.00,1.00)
    \cnodegreen(0.65,0.15){0.15}{Boa}
    \psline[linewidth=0.1]{->}(1.5,-0.2)(0.84,0.16)
     &
    \\
%
    &    [mnode =r, name = Repetir]%
    \psframebox[shadow=true,framearc = 0.15,]{\begin{tabular}{c@{\hskip\itemsep}p{7cm}} %
     \textbullet & Actualizar Lista Tabú\\
     \textbullet & Aceptar Vecino Elegido como nueva solución\\
     \textbullet & Repetir proceso hasta alcanzar el máximo de iteraciones.\\
      \textbullet & Si se han agotado la iteraciones, tomar como Solución, la mejor de todas las visitadas
     \end{tabular}}
%}%
\end{psmatrix}
%%% Links
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4}
\ncline{LT}{CA}_{Si}
{\psset{nodesepB = 1.20}%
 \ncline[nodesepA = 1.65cm]{SA}{GV}%
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{Vvacia}{EMV}^{No}
 \ncline[nodesepA = 7pt, nodesepB = 1.15]{LT}{Ace}^{No}%
 \ncline[nodesepB = 1.65cm]{CA}{Wr}^{No}
 \ncangle[nodesepA = 7pt, angleA = -90]{CA}{Ace}\nbput[npos =0.4]{Si}}%
 \ncline[nodesepA = 1.67cm]{EMV}{LT}%
 \ncline[nodesepA = 1.65cm]{GV}{Vvacia}
 \ncangle[nodesepA = 1.25, angleA = 90]{Wr}{Vvacia}
 \ncline{Vvacia}{Vfin}^{Si} %[nodesepA = 0.1cm]
 \ncline[nodesepA = 1.25cm]{Ace}{Repetir}
%}

\end{document} 

在此处输入图片描述

相关内容