Skip to content

Commit

Permalink
Merge pull request #227 from Marchonq/patch-1
Browse files Browse the repository at this point in the history
fix: ACA complains 'np.int' not found in new nump version
  • Loading branch information
guofei9987 authored Jun 23, 2024
2 parents f7e6f06 + 3096cb1 commit adfd8e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sko/ACA.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def __init__(self, func, n_dim,
self.prob_matrix_distance = 1 / (distance_matrix + 1e-10 * np.eye(n_dim, n_dim)) # 避免除零错误

self.Tau = np.ones((n_dim, n_dim)) # 信息素矩阵,每次迭代都会更新
self.Table = np.zeros((size_pop, n_dim)).astype(int) # 某一代每个蚂蚁的爬行路径

self.Table = np.zeros((size_pop, n_dim), dtype=int) # 某一代每个蚂蚁的爬行路径

self.y = None # 某一代每个蚂蚁的爬行总距离
self.generation_best_X, self.generation_best_Y = [], [] # 记录各代的最佳情况
self.x_best_history, self.y_best_history = self.generation_best_X, self.generation_best_Y # 历史原因,为了保持统一
Expand Down

0 comments on commit adfd8e5

Please sign in to comment.