<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def roll_out_and_store(self, batch_info):
 """ Roll out environment and store result in the replay buffer """

        self.model.train()

        if self.env_roller.is_ready_for_sampling():
            rollout = self.env_roller.rollout(batch_info, self.model, self.settings.rollout_steps).to_device(self.device)

            # Store some information about the rollout, no training phase
            batch_info['frames'] = rollout.frames()
            batch_info['episode_infos'] = rollout.episode_information()
        else:
            frames = 0
            episode_infos = []

            with tqdm.tqdm(desc="Populating memory", total=self.env_roller.initial_memory_size_hint()) as pbar:
                while not self.env_roller.is_ready_for_sampling():
                    rollout = self.env_roller.rollout(batch_info, self.model, self.settings.rollout_steps).to_device(self.device)

                    new_frames = rollout.frames()
                    frames += new_frames
                    episode_infos.extend(rollout.episode_information())

                    pbar.update(new_frames)

            # Store some information about the rollout, no training phase
            batch_info['frames'] = frames
            batch_info['episode_infos'] = episode_infos