def execute(self, action):
action_mappings, axis_mappings = [], []<EOL>if self.discretize_actions:<EOL><INDENT>combination = self.discretized_actions[action]<EOL>for key, value in combination:<EOL><INDENT>if isinstance(value, bool):<EOL><INDENT>action_mappings.append((key, value))<EOL><DEDENT>else:<EOL><INDENT>axis_mappings.append((key, value))<EOL><DEDENT><DEDENT><DEDENT>elif action:<EOL><INDENT>try:<EOL><INDENT>action_mappings, axis_mappings = self.translate_abstract_actions_to_keys(action)<EOL><DEDENT>except KeyError as e:<EOL><INDENT>raise TensorForceError("<STR_LIT>".<EOL>format(e))<EOL><DEDENT><DEDENT>message = dict(<EOL>cmd="<STR_LIT>",<EOL>delta_time=self.delta_time,<EOL>num_ticks=self.num_ticks,<EOL>actions=action_mappings,<EOL>axes=axis_mappings<EOL>)<EOL>self.protocol.send(message, self.socket)<EOL>response = self.protocol.recv(self.socket)<EOL>r = response.pop(b"<STR_LIT>", <NUM_LIT:0.0>)<EOL>is_terminal = response.pop(b"<STR_LIT>", False)<EOL>obs = self.extract_observation(response)<EOL>self.last_observation = obs<EOL>return obs, is_terminal, r<EOL>
Executes a single step in the UE4 game. This step may be comprised of one or more actual game ticks for all of
which the same given
action- and axis-inputs (or action number in case of discretized actions) are repeated.
UE4 distinguishes between action-mappings, which are boolean actions (e.g. jump or dont-jump) and axis-mappings,
which are continuous actions
like MoveForward with values between -1.0 (run backwards) and 1.0 (run forwards), 0.0 would mean: stop.