MTRF/r3l/r3l/r3l_envs/inhand_env/basket.py [568:600]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        else:
            print("Should not have reached this condition with: "
                  f"repos_xy_dist={repos_xy_dist}, object_xyz={object_xyz}")
            raise NotImplementedError

        if self._verbose:
            print("TASK ADJACENCY MATRIX:\n", self.task_adj_matrix)

        # The `self.phase` row of the adjacency matrix gives you next-phase
        # transition probabilities.
        task_adj_list = self.task_adj_matrix[self.phase]
        assert np.sum(task_adj_list) == 1
        if self._random_task_graph:
            # Removed the probability from the choice list
            next_phase = self.np_random.choice(self.num_phases)
        else:
            next_phase = self.np_random.choice(self.num_phases, p=task_adj_list)

        return next_phase

    def set_color_phase(self, phase):
        for phase_idx in range(self.num_phases):
            if phase_idx == phase:
                self.sim.model.geom_rgba[self.sim.model.geom_name2id(f'pi{phase}')] = self.phase_to_color_idx[phase]
            else:
                darker_color = self.phase_to_color_idx[phase_idx] * 0.25
                self.sim.model.geom_rgba[self.sim.model.geom_name2id(f'pi{phase_idx}')] = darker_color

    def configure_phase(self, phase_idx):
        super().configure_phase(phase_idx)
        if self._verbose:
            print(f"NEXT PHASE = {phase_idx}")
        self.set_color_phase(phase_idx)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



MTRF/r3l/r3l/r3l_envs/inhand_env/bulb.py [594:625]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        else:
            print("Should not have reached this condition with: "
                  f"repos_xy_dist={repos_xy_dist}, object_xyz={object_xyz}")
            raise NotImplementedError

        if self._verbose:
            print("TASK ADJACENCY MATRIX:\n", self.task_adj_matrix)

        # The `self.phase` row of the adjacency matrix gives you next-phase
        # transition probabilities.
        task_adj_list = self.task_adj_matrix[self.phase]
        assert np.sum(task_adj_list) == 1
        if self._random_task_graph:
            next_phase = self.np_random.choice(self.num_phases) # Removed the probability from the choice list
        else:
            next_phase = self.np_random.choice(self.num_phases, p=task_adj_list)

        return next_phase

    def set_color_phase(self, phase):
        for phase_idx in range(self.num_phases):
            if phase_idx == phase:
                self.sim.model.geom_rgba[self.sim.model.geom_name2id(f'pi{phase}')] = self.phase_to_color_idx[phase]
            else:
                darker_color = self.phase_to_color_idx[phase_idx] * 0.25
                self.sim.model.geom_rgba[self.sim.model.geom_name2id(f'pi{phase_idx}')] = darker_color

    def configure_phase(self, phase_idx):
        super().configure_phase(phase_idx)
        if self._verbose:
            print(f"NEXT PHASE = {phase_idx}")
        self.set_color_phase(phase_idx)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



