Skip to content

Commit

Permalink
fix bugs in test
Browse files Browse the repository at this point in the history
  • Loading branch information
SunYixuan authored and SunYixuan committed Dec 22, 2024
1 parent bc90dd1 commit a7a31f9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ml4co_kit/solver/atsp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _apply_scale_and_dtype(

# dtype
if to_int:
round_func = self.get_round_func(round_func)
round_func = self._get_round_func(round_func)
dists = round_func(dists)

return dists
Expand Down
2 changes: 1 addition & 1 deletion ml4co_kit/solver/cvrp/lkh.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _solve(
check_call([self.lkh_path, para_save_path], stdout=f)

# read solution
tour = self.read_lkh_solution(tour_save_path)
tour = self._read_lkh_solution(tour_save_path)

# delete files
files_path = [
Expand Down
6 changes: 3 additions & 3 deletions ml4co_kit/solver/tsp/concorde.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def solve(
for idx in iterative_execution(range, num_points, self.solve_msg, show_time):
name = uuid.uuid4().hex
tours.append(self._solve(self.points[idx], name))
self.clear_tmp_files(name)
self._clear_tmp_files(name)
else:
batch_points = self.points.reshape(-1, num_threads, p_shape[-2], p_shape[-1])
name_list = list()
Expand All @@ -123,7 +123,7 @@ def solve(
for tour in cur_tours:
tours.append(tour)
for name in name_list:
self.clear_tmp_files(name)
self._clear_tmp_files(name)

# format
tours = np.array(tours)
Expand Down Expand Up @@ -155,7 +155,7 @@ def _clear_tmp_files(self, name):
>>> solver=TSPConcordeSolver()
# clear the temporary file
>>> solver.clear_tmp_files("tmp_file")
>>> solver._clear_tmp_files("tmp_file")
"""
real_name = name[0:9]
# tmp file
Expand Down
2 changes: 1 addition & 1 deletion ml4co_kit/solver/tsp/ga_eax_large.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _solve(self, nodes_coord: np.ndarray) -> list:
)

# read data from .sol
tours = self.read_solution(sol_abs_path_1)
tours = self._read_solution(sol_abs_path_1)
costs = np.array([eval.evaluate(tour) for tour in tours])
min_cost_idx = np.argmin(costs)
best_tour = tours[min_cost_idx].tolist()
Expand Down
2 changes: 1 addition & 1 deletion ml4co_kit/solver/tsp/ga_eax_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _solve(self, nodes_coord: np.ndarray) -> list:
)

# read data from .sol
tours = self.read_solution(sol_abs_path_1)
tours = self._read_solution(sol_abs_path_1)
costs = np.array([eval.evaluate(tour) for tour in tours])
min_cost_idx = np.argmin(costs)
best_tour = tours[min_cost_idx].tolist()
Expand Down

0 comments on commit a7a31f9

Please sign in to comment.