diff --git a/solvers/hsgw b/solvers/hsgw index 5e5c48717d206c28cf08e7295c19b8a22346a7c5..f2e4e6c80ba0d717151dbbe38e99f69691658e2f 160000 --- a/solvers/hsgw +++ b/solvers/hsgw @@ -1 +1 @@ -Subproject commit 5e5c48717d206c28cf08e7295c19b8a22346a7c5 +Subproject commit f2e4e6c80ba0d717151dbbe38e99f69691658e2f diff --git a/utils/__init__.py b/utils/__init__.py index e5c55200e1375882250d6e4d15b21e6eb093bdb6..be4439c854b125a22a6775f0cbc8e5b313bdc962 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -1 +1 @@ -from .data import Problem +from .data import Problem, Solution diff --git a/utils/data.py b/utils/data.py index c0707081fbbae3a95a8245c2b59f1e0bce9f13ca..8e33a9c13373ea1f773d5e9e3bb358397c5ac860 100644 --- a/utils/data.py +++ b/utils/data.py @@ -80,8 +80,12 @@ class Problem(object): problem_text = '' num_tiles = 0 line_remap_list = list() + line_remap_list.append(0) + block_remap_list = list() + block_remap_list.append(0) block_text = '' for bi, bn in enumerate(g): + block_remap_list.append(bn) b = self.blocks[bn] num_tiles += b['num_tiles'] @@ -93,7 +97,7 @@ class Problem(object): if isinstance(bc, int) and bc > 0: if not bc in line_remap_list: line_remap_list.append(bc) - remapped_index = line_remap_list.index(bc) + 1 + remapped_index = line_remap_list.index(bc) br_cells.append(str(remapped_index)) else: br_cells.append(str(bc)) @@ -106,7 +110,7 @@ class Problem(object): problem_text += '\n' problem_text += block_text - group_problems.append(problem_text) + group_problems.append((problem_text, line_remap_list, block_remap_list)) return group_problems @@ -348,7 +352,7 @@ class Solution(object): self._id = str(uuid.uuid4()) self._parse_solution() - + def _parse_solution(self): if self.status != 'done':