mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
remove unmodified dunder methods
This commit is contained in:
parent
071c22a809
commit
b5a820a8d9
3 changed files with 0 additions and 42 deletions
|
|
@ -50,20 +50,6 @@ class NQueensDataset(ProceduralDataset):
|
|||
super().__init__(config=config, seed=config.seed, size=config.size)
|
||||
self._solutions = self._get_all_solutions(config.n)
|
||||
|
||||
def __len__(self) -> int:
|
||||
return self.config.size
|
||||
|
||||
def __iter__(self):
|
||||
self._current_idx = 0
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
if self._current_idx >= self.config.size:
|
||||
raise StopIteration
|
||||
item = self[self._current_idx]
|
||||
self._current_idx += 1
|
||||
return item
|
||||
|
||||
def _get_all_solutions(self, n: int) -> List[List[List[str]]]:
|
||||
"""Get all solutions for the N Queens puzzle"""
|
||||
|
||||
|
|
|
|||
|
|
@ -54,20 +54,6 @@ class CourseScheduleDataset(ProceduralDataset):
|
|||
def __init__(self, config: CourseScheduleConfig):
|
||||
super().__init__(config=config, seed=config.seed, size=config.size)
|
||||
|
||||
def __len__(self) -> int:
|
||||
return self.config.size
|
||||
|
||||
def __iter__(self):
|
||||
self._current_idx = 0
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
if self._current_idx >= self.config.size:
|
||||
raise StopIteration
|
||||
item = self[self._current_idx]
|
||||
self._current_idx += 1
|
||||
return item
|
||||
|
||||
def _can_finish(self, num_courses: int, prerequisites: List[List[int]]) -> bool:
|
||||
adj = defaultdict(list)
|
||||
for course, prereq in prerequisites:
|
||||
|
|
|
|||
|
|
@ -55,20 +55,6 @@ class LargestIslandDataset(ProceduralDataset):
|
|||
def __init__(self, config: LargestIslandConfig):
|
||||
super().__init__(config=config, seed=config.seed, size=config.size)
|
||||
|
||||
def __len__(self) -> int:
|
||||
return self.config.size
|
||||
|
||||
def __iter__(self):
|
||||
self._current_idx = 0
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
if self._current_idx >= self.config.size:
|
||||
raise StopIteration
|
||||
item = self[self._current_idx]
|
||||
self._current_idx += 1
|
||||
return item
|
||||
|
||||
def _is_valid_cell(self, r: int, c: int) -> bool:
|
||||
return 0 <= r < self.config.rows and 0 <= c < self.config.cols
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue