def roll_out_and_store(self, batch_info):
self.model.train()<EOL>if self.env_roller.is_ready_for_sampling():<EOL><INDENT>rollout = self.env_roller.rollout(batch_info, self.model, self.settings.rollout_steps).to_device(self.device)<EOL>batch_info['<STR_LIT>'] = rollout.frames()<EOL>batch_info['<STR_LIT>'] = rollout.episode_information()<EOL><DEDENT>else:<EOL><INDENT>frames = <NUM_LIT:0><EOL>episode_infos = []<EOL>with tqdm.tqdm(desc="<STR_LIT>", total=self.env_roller.initial_memory_size_hint()) as pbar:<EOL><INDENT>while not self.env_roller.is_ready_for_sampling():<EOL><INDENT>rollout = self.env_roller.rollout(batch_info, self.model, self.settings.rollout_steps).to_device(self.device)<EOL>new_frames = rollout.frames()<EOL>frames += new_frames<EOL>episode_infos.extend(rollout.episode_information())<EOL>pbar.update(new_frames)<EOL><DEDENT><DEDENT>batch_info['<STR_LIT>'] = frames<EOL>batch_info['<STR_LIT>'] = episode_infos<EOL><DEDENT>
Roll out environment and store result in the replay buffer