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
263ea10c
Commit
263ea10c
authored
Feb 08, 2013
by
Steven Cordwell
Browse files
dict tests for new ability to accept new types in check()
parent
a04d5210
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_mdptoolbox.py
View file @
263ea10c
...
...
@@ -99,6 +99,29 @@ def test_check_P_square_stochastic_nonnegative_list_sparse():
P
.
append
(
speye
(
STATES
,
STATES
).
tocsr
())
assert
(
check
(
P
,
R
)
==
None
)
# check: P - square, stochastic and non-negative dicts
def
test_check_P_square_stochastic_nonnegative_dict_array
():
P
=
{}
R
=
rand
(
STATES
,
ACTIONS
)
for
a
in
xrange
(
ACTIONS
):
P
[
a
]
=
eye
(
STATES
)
assert
(
check
(
P
,
R
)
==
None
)
def
test_check_P_square_stochastic_nonnegative_dict_matrix
():
P
=
[]
R
=
rand
(
STATES
,
ACTIONS
)
for
a
in
xrange
(
ACTIONS
):
P
[
a
]
=
matrix
(
eye
(
STATES
))
assert
(
check
(
P
,
R
)
==
None
)
def
test_check_P_square_stochastic_nonnegative_dict_sparse
():
P
=
[]
R
=
rand
(
STATES
,
ACTIONS
)
for
a
in
xrange
(
ACTIONS
):
P
[
a
]
=
speye
(
STATES
,
STATES
).
tocsr
()
assert
(
check
(
P
,
R
)
==
None
)
# check: R - square stochastic and non-negative sparse
def
test_check_R_square_stochastic_nonnegative_sparse
():
...
...
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