Skip to content

Instantly share code, notes, and snippets.

@pierrelux
Created September 9, 2013 21:29
Show Gist options
  • Save pierrelux/6501790 to your computer and use it in GitHub Desktop.
Save pierrelux/6501790 to your computer and use it in GitHub Desktop.
The Agent-Environment Interaction figure from Reinforcement Learning: An Introduction by Richard S. Sutton and Andrew G. Barto reproduced in Tikz
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\tikzstyle{block} = [rectangle, draw,
text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex]
\begin{tikzpicture}[node distance = 6em, auto, thick]
\node [block] (Agent) {Agent};
\node [block, below of=Agent] (Environment) {Environment};
\path [line] (Agent.0) --++ (4em,0em) |- node [near start]{Action $a_t$} (Environment.0);
\path [line] (Environment.190) --++ (-6em,0em) |- node [near start] {New state $s_{t+1}$} (Agent.170);
\path [line] (Environment.170) --++ (-4.25em,0em) |- node [near start, right] {Reward $r_{t+1}$} (Agent.190);
\end{tikzpicture}
\end{document}
@balzer82
Copy link

Thanks!!!

@yun-long
Copy link

Thanks

@s-mawjee
Copy link

Thank you.

@realwenlongwang
Copy link

Thanks for the sharing!

@tahaeghtesad
Copy link

Awesome! With much thanks!

@ZdM87
Copy link

ZdM87 commented Jul 23, 2020

What does Environment.190 mean?

@daanklijn
Copy link

Merci!

@wiktor-waj
Copy link

A thousand thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment