Ghost---Shadow / Traffic-Optimization-System

A Traffic Optimization system in C++ using a rudimentary ant colony optimization technique.
2 stars 2 forks source link

Time calculation for each driver #1

Open anand-tambekar opened 6 years ago

anand-tambekar commented 6 years ago

I was exploring some projects for traffic optimisation and came across your project. I tried understanding it and there's just one doubt that I face and it will help if you may explain. After the code is run, when the new path file is created, there is either an issue or maybe I'm unable to understand about how the counter functionality is increasing for time. It surely is not linear as increment of 1 for each occupied cell, since that is not being the same for many of the driver cases in the created path file. Can you please explain this functionality.

anand-tambekar commented 6 years ago

32510479-bf446a14-c416-11e7-889e-da90597cc381

Ghost---Shadow commented 6 years ago

I made this in my freshman year in college. It is not to be taken seriously :P

Anyways, the idea was, for each car:

  1. Use Dijkstra to find a path, each time a cell is traversed, increase the time counter by 1.
  2. Each cell traversed by a car at time t increases the weight of that cell for that specific time.

The increase of weight in the presence of cars is used as a proxy idea for traffic congestion. It is basically Dijkstra in 3D where the third dimension is time and you cannot travel back in time.

About the image you posted. The cells were occupied at some time but not at the time the car traversed it. So, the weight is still zero. That is the selling point of this "algorithm" if you can call it that.

In hindsight this might cause it to get stuck in local optima because you cannot travel down the space time cube.

I have uploaded a .ppt it has diagrams and explanation. I hope it clears stuff up.