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
bf04775e
Commit
bf04775e
authored
Sep 11, 2013
by
Steven Cordwell
Browse files
use return() instead of return ()
parent
6909d0bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mdptoolbox/example.py
View file @
bf04775e
...
...
@@ -175,7 +175,7 @@ def forest(S=3, r1=4, r2=2, p=0.1, is_sparse=False):
R
[
0
,
1
]
=
0
R
[
S
-
1
,
1
]
=
r2
# we want to return the generated transition and reward matrices
return
(
P
,
R
)
return
(
P
,
R
)
def
rand
(
S
,
A
,
is_sparse
=
False
,
mask
=
None
):
"""Generate a random Markov Decision Process.
...
...
@@ -278,7 +278,7 @@ def rand(S, A, is_sparse=False, mask=None):
P
[
a
][
s
]
=
P
[
a
][
s
]
/
P
[
a
][
s
].
sum
()
R
[
a
][
s
]
=
(
m
*
(
2
*
random
(
S
)
-
ones
(
S
,
dtype
=
int
)))
# we want to return the generated transition and reward matrices
return
(
P
,
R
)
return
(
P
,
R
)
if
__name__
==
"__main__"
:
import
doctest
...
...
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