This is what I want to achieve:
This is what I have done so far:
This is the code to reproduce my image. I was inspired by this answer:
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,shadows,positioning}
\tikzset{
frame/.style={
rectangle, draw,
text width=6em, text centered,
minimum height=4em,drop shadow,fill=white,
rounded corners,
},
line/.style={
draw, -latex',rounded corners=3mm,
}
}
\begin{document}
\begin{tikzpicture}[font=\small\sffamily\bfseries,very thick,node distance = 4cm]
\node [frame] (agent) {Agent};
\node [below right of=agent] (aer) {};
\node [below left of=agent] (ael) {};
\node [frame, below left of=aer] (environment) {Environment};
\path [line] (agent)
-| node[right, pos=1, align=left] {action\\ $A_t$} (aer)
|- (environment);
\path [line] (environment.170)
-| node[right, pos=1, align=left] {reward\\ $R_t$} (ael)
|- (agent.190);
\path [line] (environment.190)
-| node[left, pos=1, align=right] {state\\ $s_t$} (ael)
|- (agent.170);
\end{tikzpicture}
\end{document}
I don't want a perfect result. I'm interested in maintaining the reward of state and reward separated and I don't want that blank space at the center of each path. Maybe a better way to start/end paths would be appreciated: currently, it's done with an angle but I don't know which is the actual distance between lines.
This is how I modified marmot's answer to have the same distance between state and reward lines both horizontally and vertically.
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shadows,positioning}
\tikzset{
frame/.style={
rectangle, draw,
text width=6em, text centered,
minimum height=4em,drop shadow,fill=white,
rounded corners,
},
line/.style={
draw, -{Latex},rounded corners=3mm,
}
}
\begin{document}
\begin{tikzpicture}[font=\small\sffamily\bfseries,very thick,node distance = 4cm]
\node [frame] (agent) {Agent};
\node [frame, below=1.2cm of agent] (environment) {Environment};
\draw[line] (agent) -- ++ (3.5,0) |- (environment)
node[right,pos=0.25,align=left] {action\\ $A_t$};
\coordinate[left=8mm of environment] (P);
\coordinate[above=3mm of environment.west] (ENW);
\coordinate[below=3mm of environment.west] (ESW);
\coordinate[above=3mm of agent.west] (ANW);
\coordinate[below=3mm of agent.west] (ASW);
\draw[thin,dashed] (P|-environment.north) -- (P|-environment.south);
\draw[line] (ESW) -- (P |- ESW)
node[midway,above]{$S_{i+1}$};
\draw[line,thick] (ENW) -- (P |- ENW)
node[midway,above]{$R_{i+1}$};
\draw[line] (P |- ESW) -- ++ (-1.4,0) |- (ANW)
node[left, pos=0.25, align=right] {state\\ $s_t$};
\draw[line,thick] (P |- ENW) -- ++ (-0.8,0) |- (ASW)
node[right,pos=0.25,align=left] {reward\\ $R_t$};
\end{tikzpicture}
\end{document}
And this is the result.
This is already the visual result that I wanted to achieve. The question is if I could have avoided to define four new coordinates (ASW,ANW,ESW,ENW).