Giter Club home page Giter Club logo

Comments (4)

cptanalatriste avatar cptanalatriste commented on July 30, 2024

Hello @drissDean !

Isula's implementation of ACO algorithms look for solutions with the minimum cost. These solutions are generated by instances of Ant, and the cost is obtained by the method Ant::getSolutionCost(). In a TSP instance, the cost is expressed in terms of distance. If you have a different cost metric, just override Ant::getSolutionCost() with the logic that suits your domain.

from isula.

drissDean avatar drissDean commented on July 30, 2024

Thank you very much.
I'm striving to keep the minimum cost too. The issue with the Euclidean system is that no two cities in a country are joined with a straightforward path. We can even find watercourses or other things we would have to bypass and that would make the distance much longer. So I need to take into account certain real factors for the system I have to build. I actually try to deliver the best itinerary given the actual traffic data, not only distances between points.
Since I've taken the aco-acs-tsp implementation, then I have to create my own class which would extend AntForTsp class (and overload the getSolutionCost() method) and use it anywhere we had AntForTsp class before?

from isula.

cptanalatriste avatar cptanalatriste commented on July 30, 2024

Hi @drissDean ,

I would approach it this way:

  1. Extend AntForTsp , for example CustomAntForTsp, overriding getSolutionCost(). According to your problem, you might also need to override getHeuristicValue().
  2. Use these new type CustomAntForTsp when creating the AntColony instance for your AcoProblemSolver. Take a look at the getAntColony method at AcoTspWithIsula.

Good luck!

from isula.

drissDean avatar drissDean commented on July 30, 2024

Alright, sir. Thank you so much.

from isula.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.