Commit 6b126aec authored by Steven Cordwell's avatar Steven Cordwell

[example] Add example usage for the small example

Add an example usage for the small example to the docstring for test
coverage purposes.
parent ad93b411
...@@ -362,6 +362,21 @@ def small(): ...@@ -362,6 +362,21 @@ def small():
out : tuple out : tuple
``out[0]`` is a numpy array of the probability transition matriices. ``out[0]`` is a numpy array of the probability transition matriices.
``out[1]`` is a numpy arrray of the reward matrix. ``out[1]`` is a numpy arrray of the reward matrix.
Examples
========
>>> import mdptoolbox.example
>>> P, R = mdptoolbox.example.small()
>>> P
array([[[ 0.5, 0.5],
[ 0.8, 0.2]],
<BLANKLINE>
[[ 0. , 1. ],
[ 0.1, 0.9]]])
>>> R
array([[ 5, 10],
[-1, 2]])
""" """
P = _np.array([[[0.5, 0.5],[0.8, 0.2]],[[0, 1],[0.1, 0.9]]]) P = _np.array([[[0.5, 0.5],[0.8, 0.2]],[[0, 1],[0.1, 0.9]]])
R = _np.array([[5, 10], [-1, 2]]) R = _np.array([[5, 10], [-1, 2]])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment