Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pymdptoolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
0
Requirements
0
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zahra Rajabi
pymdptoolbox
Commits
7fa677ca
Commit
7fa677ca
authored
Jan 20, 2013
by
Steven Cordwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docstring fixes
parent
40b39d86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
mdp.py
mdp.py
+12
-9
No files found.
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
_value_i
teration applies the value iteration algorithm to solve
mdp
.ValueI
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 iterations
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 computation
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