You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I managed to get your code to run, but it took some modifications. In the 'Example usage' I used the following code to get it to run in a new python file in the same directory:
from AntColonyOptimizer import AntColonyOptimizer
import numpy as np
problem = some_distance_matrix
best = optimizer.fit(problem, 100)
optimizer.plot()
With this I managed to get a performance vs iterations graph (an odd one...) but I'm uncertain on how to get the code to display the optimal path and the minimum cost. Any advice?
Thanks,
George
The text was updated successfully, but these errors were encountered:
Hi @georgesakarellos! What did you need to change to get it to run? Seems to run fine on my local machine.
I don't have any code to display the optimal path, although that should be saved in self.best_path, so creating one shouldn't be too hard. Minimum cost should be saved in self.best.
Note that it's been quite some time since I wrote this code, so I'm a bit rusty with it 😄. But if you have any other questions, feel free to ask!
Hi John!
I managed to get your code to run, but it took some modifications. In the 'Example usage' I used the following code to get it to run in a new python file in the same directory:
from AntColonyOptimizer import AntColonyOptimizer
import numpy as np
problem = some_distance_matrix
problem = np.array(problem)
optimizer = AntColonyOptimizer(ants=1, evaporation_rate=.1, intensification=2, alpha=1, beta=1,
beta_evaporation_rate=0, choose_best=.1)
best = optimizer.fit(problem, 100)
optimizer.plot()
With this I managed to get a performance vs iterations graph (an odd one...) but I'm uncertain on how to get the code to display the optimal path and the minimum cost. Any advice?
Thanks,
George
The text was updated successfully, but these errors were encountered: