Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
pymdptoolbox
Commits
7fa677ca
Commit
7fa677ca
authored
Jan 20, 2013
by
Steven Cordwell
Browse files
docstring fixes
parent
40b39d86
Changes
1
Hide whitespace changes
Inline
Side-by-side
mdp.py
View file @
7fa677ca
...
...
@@ -526,7 +526,7 @@ class PolicyIteration(MDP):
#self.value = matrix(zeros((self.S, 1)))
else
:
if
(
len
(
initial_value
)
!=
self
.
S
):
raise
Typ
eError
(
"The initial value must be length S"
)
raise
Valu
eError
(
"The initial value must be length S"
)
self
.
value
=
matrix
(
initial_value
)
...
...
@@ -799,9 +799,9 @@ class ValueIteration(MDP):
Description
-----------
mdp
_v
alue
_i
teration applies the value iteration algorithm to solve
mdp
.V
alue
I
teration applies the value iteration algorithm to solve
discounted MDP. The algorithm consists in solving Bellman's equation
iteratively.
iteratively.
Iterating is stopped when an epsilon-optimal policy is found or after a
specified number (max_iter) of iterations.
This function uses verbose and silent modes. In verbose mode, the function
...
...
@@ -813,7 +813,6 @@ class ValueIteration(MDP):
Parameters
----------
P : transition matrix
P could be a numpy ndarray with 3 dimensions (AxSxS) or a
numpy ndarray of dytpe=object with 1 dimenion (1xA), each
...
...
@@ -836,12 +835,12 @@ class ValueIteration(MDP):
Data Attributes
---------------
value : value function
A vector which stores the optimal value function.
It exists only after
the
iterate() method has
been called
. Shape is (S, ).
A vector which stores the optimal value function.
Prior to calling the
iterate() method
it
has
a value of None
. Shape is (S, ).
policy : epsilon-optimal policy
A vector which stores the optimal policy.
It exists only after
the
iterate() method has
been called
. Shape is (S, ).
iter : number of
done iter
ation
s
A vector which stores the optimal policy.
Prior to calling the
iterate() method
it
has
a value of None
. Shape is (S, ).
iter : number of
iterations taken to complete the comput
ation
An integer
time : used CPU time
A float
...
...
@@ -982,6 +981,10 @@ class ValueIteration(MDP):
def
iterate
(
self
):
"""
"""
if
self
.
verbose
:
print
(
' Iteration V_variation'
)
self
.
time
=
time
()
done
=
False
while
not
done
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment