Update interacting loops
authorThomas Pietrzak <thomas.pietrzak@gmail.com>
Tue, 5 Apr 2022 08:01:21 +0000 (10:01 +0200)
committerThomas Pietrzak <thomas.pietrzak@gmail.com>
Tue, 5 Apr 2022 08:01:21 +0000 (10:01 +0200)
figures/interactingloops.tex

index a39d776fa7082ad526b631902c2cf0e1408a5622..39eb35520d95651e75f800ced035e4f4633c80d3 100644 (file)
@@ -2,36 +2,41 @@
 
 \begin{figure}[htb]
   \centering
-  \newcommand{\labelcell}[2]{
-  \node[minimum width=2.5cm, minimum height=.85cm,text width=2.0cm, align=center, outer sep=0](#1) {#2};
+  % 1: name
+  % 2: label
+  % 3: position
+  \newcommand{\labelcell}[3]{
+    \node[minimum width=2.5cm, minimum height=.85cm,text width=2.0cm, align=center, outer sep=0](#1) at (#3) {#2};
   }
-  \newcommand{\bluecell}[2]{
-    \node[minimum width=2.1cm, minimum height=.85cm,fill=myblue, text=white,text width=2cm, align=center, rounded corners=2ex, outer sep=0](#1) {#2};
-  }
-  \newcommand{\redcell}[2]{
-    \node[minimum width=2.1cm, minimum height=.85cm,fill=myred, text=white,text width=2cm, align=center, rounded corners=2ex, outer sep=0](#1) {#2};
+  % 1: name
+  % 2: label
+  % 3: color
+  % 4: position
+  \newcommand{\mycell}[4]{
+    \node[minimum width=2.1cm, minimum height=.85cm,fill=#3, text=white,text width=2cm, align=center, rounded corners=2ex, outer sep=0](#1) at (#4) {#2};
   }
   \tikzexternalenable
-  \begin{tikzpicture}
+  \begin{tikzpicture}[x=1mm, y=1mm]
     \small
-    \matrix[row sep=4mm, column sep=0,inner sep=0, node distance=0, outer sep=5mm] (cells) {
-     & \labelcell{perception}{Perception} & \labelcell{output}{Output} & \\
-     \redcell{user}{User} & \labelcell{sensorimotor}{Sensorimotor loop} & \labelcell{execution}{Execution loop} & \bluecell{system}{System}\\
-     & \labelcell{action}{Action} & \labelcell{input}{Input} & \\
-    };
-    \draw [line width=2mm, draw=black!20, fill=black!50]
-      (perception.north east) edge (action.south east);
-      % \draw [->, -stealth', line width=1mm, draw=black!60,shorten >= -1.5mm, shorten <= -1.5mm]
-      % (sensorimotor.north east) edge[bend right] (user.north east)
-      % (user.south east) edge[bend right] (sensorimotor.south east)
-      % (execution.south west) edge[bend right] (system.south west)
-      % (system.north west) to[bend right] (execution.north west);
-      \draw [->, -stealth', line width=1mm, draw=myred!50!black, shorten >= -1.5mm, shorten <= 0.0mm] (sensorimotor.east) to[out=90,in=45] (user.north east);
-      \draw [->, -stealth', line width=1mm, draw=myblue!50!black, shorten >= -1.5mm, shorten <= 0.0mm] (execution.west) to[out=-90,in=225] (system.south west);
+    % Middle line
+    \draw [line width=30, draw=black!20, fill=black!50] (0,-20) -- (0,20);
+
+    \mycell{user}{User}{myred}{-50, 0}
+    \mycell{system}{System}{myblue}{50, 0}
+
+    \labelcell{sensorimotor}{Sensorimotor loop}{-20,0}
+    \labelcell{execution}{Execution loop}{20,0}
+
+    %Perception
+    \draw[->, -stealth', line width=1mm, draw=myred!50!black, shorten >= -4.0, shorten <= 0.0] (-2,0) to[out=90,in=45, looseness=1.1] node[pos=0.8, above, rotate=20] {Perception} (user.north east);
+    %Action
+    \draw [->, -stealth', line width=1mm, draw=myred!50!black, shorten <= -4.0] (user.south east) to[out=-45,in=270, looseness=1.1] node[pos=0.2, below, rotate=-20] {Action} (-2,0);
 
-      \draw [->, -stealth', line width=1mm, draw=myred!50!black, shorten <= -1.5mm] (user.south east) to[out=-45,in=270] (sensorimotor.east);
-      \draw [->, -stealth', line width=1mm, draw=myblue!50!black, shorten <= -1.5mm] (system.north west) to[out=135,in=90] (execution.west);
-      \end{tikzpicture}
+    %Input
+    \draw[->, -stealth', line width=1mm, draw=myblue!50!black, shorten >= -4.0, shorten <= 0.0] (2,0) to[out=-90,in=225, looseness=1.1] node[pos=0.8, below, rotate=20] {Input} (system.south west);
+    %Output
+    \draw [->, -stealth', line width=1mm, draw=myblue!50!black, shorten <= -4.0] (system.north west) to[out=135,in=90, looseness=1.1] node[pos=0.2, above, rotate=-20] {Output} (2,0);
+  \end{tikzpicture}
   \tikzexternaldisable
   \caption{The similarity of a user and a system interacting with their environment, and through which they can interact together.}
   \label{fig:loops}