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
08372d23
Commit
08372d23
authored
Aug 16, 2013
by
Steven Cordwell
Browse files
a bugfix
parent
2faee2d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
mdp.py
View file @
08372d23
...
...
@@ -602,10 +602,10 @@ def exampleRand(S, A, is_sparse=False, mask=None):
m
=
mask
[
s
]
# Make sure that there is atleast one transition in each state
if
m
.
sum
()
==
0
:
P
[
a
,
s
,
randint
(
0
,
S
)]
=
1
else
:
P
[
a
][
s
]
=
m
*
rand
(
S
)
P
[
a
][
s
]
=
P
[
a
][
s
]
/
P
[
a
][
s
].
sum
()
m
[
randint
(
0
,
S
)]
=
1
n
=
1
P
[
a
][
s
]
=
m
*
rand
(
S
)
P
[
a
][
s
]
=
P
[
a
][
s
]
/
P
[
a
][
s
].
sum
()
R
[
a
][
s
]
=
(
m
*
(
2
*
rand
(
S
)
-
ones
(
S
,
dtype
=
int
)))
# we want to return the generated transition and reward matrices
return
(
P
,
R
)
...
...
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