Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with problem reading and solution suggestion #6

Open
drissDean opened this issue Jul 12, 2021 · 4 comments
Open

Issue with problem reading and solution suggestion #6

drissDean opened this issue Jul 12, 2021 · 4 comments

Comments

@drissDean
Copy link

I'm using the framework in particular way. I have to determine pathways between cities of my own. Now each time I had a problem to solve, I'd override a tsp file I created. The thing is when I was trying to solve a new problem, the getRepresentationFromFile() method was returning me the previous problem. I bypassed it by using my own method which were rendering the problem representation from an arraylist (instead of a file).
Now the other issue I have is that whenever I passed to the algorithm only close cities or neighborhoods coordinates, the algorithm would fail. There should be at least one long distance between two points for the algorithm to work. It'd break otherwise.
I don't know what's the real issue and how to fix it. And I need to do more: instead of using the Euclidean methods to calculate distances, I want to use a geolocation service API to use the actual estimated travel time between 2 points plus the estimated time to spend on each point.
I think that having my own getDistance() method (which calls the API and do stuffs) would help me do that but I'm not sure it'll prevent the program from crashing if the two points are still close.

Any way you can help me? It's for my internship

@cptanalatriste
Copy link
Owner

I do not think I have enough information from your post to be able to suggest a solution. Can you please provide a minimal reproducible example?

@drissDean
Copy link
Author

drissDean commented Jul 12, 2021 via email

@drissDean
Copy link
Author

first

this is the servlet that receives the information about what to do (to make it simple, which places to join)

second

I'm dealing with what I call interventions in my system. An intervention embeds a place (lat, long). I extract all the places and make a call to the solve() method which comes next.

third

the solve method is exactly the one in the aco-acs-tsp-master repo except that instead of reading a file I'm passing the function the data.

the data are passed originally to an Angular program which presents them to the user. the user picks the interventions he wants and the interventions' ids are sent back to the server. once I identify which interventions are picked, I extract the locations and pass them to the ACO algorithm to get an order of execution.
It's weird that I executed the whole program and it didn't show any error. But it used to throw an exception (I didn't note). it was something like "couldn't get heuristic value" if I remember well. I'm afraid this is a fantom bug that comes and goes without me knowing why.

@drissDean
Copy link
Author

I think it had something to do with the getDistance() method somehow I don't know why?

But anyhow, since all this is working (and I hope it keeps going that way), the next thing I want to do is to use real traffic data and estimated times of interventions (because when we reach one place, there a time spent there to do some job) instead of the classic Euclidean method.
what came to my mind was to have my own getDistance() methods which would return the travel time between two points plus the estimated intervention duration of the second point given. Is that the right thing to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants