Creates a shuffled sequence of taskset IDs to control sampling priority per step. At the start of each epoch, all tasksets are shuffled proportionally to their size, ensuring balanced exposure while introducing randomness in selection order. Args: epoch
(self, epoch: int)
| 161 | ) |
| 162 | |
| 163 | def build_orders(self, epoch: int): |
| 164 | """ |
| 165 | Creates a shuffled sequence of taskset IDs to control sampling priority per step. |
| 166 | |
| 167 | At the start of each epoch, all tasksets are shuffled proportionally to their size, |
| 168 | ensuring balanced exposure while introducing randomness in selection order. |
| 169 | |
| 170 | Args: |
| 171 | epoch (int): Epoch ID used as seed for deterministic shuffling |
| 172 | |
| 173 | Returns: |
| 174 | List[int]: Sequence of taskset IDs, length = steps_per_epoch * batch_size |
| 175 | """ |
| 176 | taskset_ids = self.base_taskset_ids.copy() |
| 177 | rng = np.random.default_rng(epoch) |
| 178 | rng.shuffle(taskset_ids) |
| 179 | return taskset_ids |
| 180 | |
| 181 | def _should_stop(self) -> bool: |
| 182 | return self.step >= self.max_steps |