Comments (5)
Have you installed the lastest version of mealpy==2.4.0 ?
I add the code and results for GA here:
https://github.com/thieu1995/MHA-TSP/blob/main/04_ga_tsp_basic.py
For GA, it has so many strategies and parameters you can turn to get a better results.
You can check the document here: https://mealpy.readthedocs.io/en/latest/pages/models/mealpy.evolutionary_based.html#module-mealpy.evolutionary_based.GA
For example:
model2 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, selection="tournament", k_way=0.4, crossover="multi_points")
model3 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, crossover="one_point", mutation="scramble")
model4 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, crossover="arithmetic", mutation_multipoints=True, mutation="swap")
model5 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, selection="roulette", crossover="multi_points")
model6 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, selection="random", mutation="inversion")
model7 = BaseGA(problem_dict1, epoch, pop_size, pc, pm, crossover="arithmetic", mutation="flip")
Best regards,
from mha-tsp.
Sorry my bad tho. I have checked my code again and see that I'm still using WOA model instead of GA model.
After test with GA model for this particular problem (TSP). It is also show the error like you've got.
I have to check the code in Mealpy library and found a problem. I forgot to call the function amend_position after the mutation_process. Therefor, for this discrete problem, GA model can't be used.
I will fix in the new version of Mealpy. You should try algorithms instead of GA. There is like 150 other algorithms you can test with.
Best regards,
from mha-tsp.
Well good to know it wasn't my lack of skill. And while it is a great tool to play with meta heuristics. I do have a dead line to use GA. I'll switch to MATLAB for now.
from mha-tsp.
Have you check the latest version of Mealpy. I've fixed the problem in GA.
from mha-tsp.
Thanks for the awesome work!
from mha-tsp.
Related Issues (2)
- Help may be required HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mha-tsp.