mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-05-01 17:45:24 +00:00
remove unmodified dunder methods
This commit is contained in:
parent
b90c50e68f
commit
2dd53241e5
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)
|
super().__init__(config=config, seed=config.seed, size=config.size)
|
||||||
self._solutions = self._get_all_solutions(config.n)
|
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]]]:
|
def _get_all_solutions(self, n: int) -> List[List[List[str]]]:
|
||||||
"""Get all solutions for the N Queens puzzle"""
|
"""Get all solutions for the N Queens puzzle"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,20 +54,6 @@ class CourseScheduleDataset(ProceduralDataset):
|
||||||
def __init__(self, config: CourseScheduleConfig):
|
def __init__(self, config: CourseScheduleConfig):
|
||||||
super().__init__(config=config, seed=config.seed, size=config.size)
|
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:
|
def _can_finish(self, num_courses: int, prerequisites: List[List[int]]) -> bool:
|
||||||
adj = defaultdict(list)
|
adj = defaultdict(list)
|
||||||
for course, prereq in prerequisites:
|
for course, prereq in prerequisites:
|
||||||
|
|
|
||||||
|
|
@ -55,20 +55,6 @@ class LargestIslandDataset(ProceduralDataset):
|
||||||
def __init__(self, config: LargestIslandConfig):
|
def __init__(self, config: LargestIslandConfig):
|
||||||
super().__init__(config=config, seed=config.seed, size=config.size)
|
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:
|
def _is_valid_cell(self, r: int, c: int) -> bool:
|
||||||
return 0 <= r < self.config.rows and 0 <= c < self.config.cols
|
return 0 <= r < self.config.rows and 0 <= c < self.config.cols
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue