Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gymz/gym_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def execute_action(self):
# Gym expects actions in different format depending on type of
# action space
if isinstance(self._env.action_space, gym.spaces.Discrete):
action = self._command_buffer[0][0]['value']
action = int(self._command_buffer[0][0]['value'])
else:
action = [self._command_buffer[0][0]['value']]

Expand Down
4 changes: 2 additions & 2 deletions gymz/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
def to_message(low, high, value):
assert(np.shape(low) == np.shape(high) == np.shape(value))
try:
return [{'min': low[i], 'max': high[i], 'value': value[i]} for i in range(len(low))]
return [{'min': float(low[i]), 'max': float(high[i]), 'value': float(value[i])} for i in range(len(low))]
except TypeError:
return [{'min': low, 'max': high, 'value': value}]
return [{'min': float(low), 'max': float(high), 'value': float(value)}]