|
|
|
|
|
|
specs = ActionSpec.create_continuous(action_len) |
|
|
|
zero_action = specs.create_empty(4) |
|
|
|
assert np.array_equal(zero_action, np.zeros((4, action_len), dtype=np.float32)) |
|
|
|
random_action = specs.create_random(4) |
|
|
|
random_action = specs.random_action(4) |
|
|
|
assert random_action.dtype == np.float32 |
|
|
|
assert random_action.shape == (4, action_len) |
|
|
|
assert np.min(random_action) >= -1 |
|
|
|
|
|
|
zero_action = specs.create_empty(4) |
|
|
|
assert np.array_equal(zero_action, np.zeros((4, len(action_shape)), dtype=np.int32)) |
|
|
|
|
|
|
|
random_action = specs.create_random(4) |
|
|
|
random_action = specs.random_action(4) |
|
|
|
assert random_action.dtype == np.int32 |
|
|
|
assert random_action.shape == (4, len(action_shape)) |
|
|
|
assert np.min(random_action) >= 0 |