def step_and_push_result_tuple()

in roboschool/multiplayer.py [0:0]


    def step_and_push_result_tuple(self):
        """
        env.step() here doesn't step the simulation, scene.global_step() does that.
        But it still calls step(a) with the same actions, in order for actions to affect reward.
        See demo_race1.py for short example of how multiplayer works internally.
        """
        if self.passive:
            return
        if not self.need_response_tuple:
            return
        state, reward, done, _ = self.env.step(self.sh_act)
        if done:
            self.passive = True
            self.done = True
            self.need_reset = True
        self.sh_obs[:] = state
        #print("%s [%s]" % (self.prefix + "obs", ", ".join(["%+0.2f"%x for x in state])))
        self.sh_rew[0] = reward
        self.need_response_tuple = False
        os.write(self.sh_pipe_obsready, b't\n' if not done else b'D\n')   # 't' for tuple