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
110b8865
Commit
110b8865
authored
Feb 10, 2013
by
Steven Cordwell
Browse files
value iteration parameter checks to be more permissive
parent
b8577327
Changes
1
Hide whitespace changes
Inline
Side-by-side
mdp.py
View file @
110b8865
...
...
@@ -1796,15 +1796,18 @@ class ValueIteration(MDP):
# initialization of optional arguments
if
initial_value
==
0
:
self
.
V
=
matrix
(
zeros
(
(
self
.
S
,
1
))
)
self
.
V
=
zeros
(
self
.
S
)
else
:
if
not
initial_value
.
shape
in
((
self
.
S
,
),
(
self
.
S
,
1
),
(
1
,
self
.
S
)):
raise
ValueError
(
"PyMDPtoolbox: The initial value must be a "
"vector of length S."
)
if
len
(
initial_value
)
!=
self
.
S
:
raise
ValueError
(
"PyMDPtoolbox: The initial value must be "
"a vector of length S."
)
else
:
self
.
V
=
matrix
(
initial_value
)
try
:
self
.
V
=
initial_value
.
reshape
(
self
.
S
)
except
AttributeError
:
self
.
V
=
array
(
initial_value
)
except
:
raise
if
self
.
discount
<
1
:
# compute a bound for the number of iterations and update the
# stored value of self.max_iter
...
...
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