180 likes | 291 Views
Random Map Generation and Pathfinding with Dynamic Point Costs. Final Version. Olex Ponomarenko. Goals for the Project. Create a fairly abstract map path-finding program Add more complex heuristics to account for things such as traffic lights, stop signs, and different amounts of roads
E N D
Random Map Generation and Pathfinding with Dynamic Point Costs Final Version Olex Ponomarenko
Goals for the Project • Create a fairly abstract map path-finding program • Add more complex heuristics to account for things such as traffic lights, stop signs, and different amounts of roads • Create a random graph generator • Create a visual representation, perhaps using Java, to display the map
Goals (but in one sentence) • Basically the idea is to create a method of searching for a path on an abstract map that would lead to simpler, more realistic results, and avoid passing through generally slow turns and intersections. (stop sign left turns onto a big street like Fairfax County Parkway, etc, are less likely to be used)
Specifics • The language used will be Python for the speed and ease of coding that it provides • Java will be used to create the visual, as Java graphics are easy to work with. • The maps and searches will be realistic, and the program overall will be as efficient as it can be, allowing large-scale data sets
First Quarter • A very basic version of the program was developed • Built upon the path finding program in the AI course • Text-only, basic coordinates, only one type of roads, and most importantly, no intersections.
First-Second Quarter To give you an idea of what the program did (since input / output are all just text) Only one type of road (no difference whether it’s a small driveway or I-95) represented One type of location No guarantee of mutually-connected locations Doesn’t account for delay or turns at intersections
Second Quarter • The RGG at this point was somewhat random – the following being a good example of the type of map it produces: Different road sizes No overlapping locations (none within 10 units of space between each other), all locations connected. BUT – Still no intersections Mostly random roads (note the only path to get to the purple one and the random 5-foot long interstate highway)
Current Generator • This is what the final version does: Realistic road structure – coherent highways, not as spastic in terms of road placement Intersections – A is a bridge with no exits, drivers on the small road (black) cannot get onto the interstate highway (red) ; at point B, drivers on the green (sort-of like Braddock) pass freely, but drivers on the small road have to go through a stop sign – meaning different wait times based on which road you’re moving on, and what turn you’re taking (left = slower, etc) B A
Other Features • Scalability – highest order function is O(n2) (finding the intersections between roads) – the program can generate maps up to 800x800 maps with 700+ locations within a minute. 200 x 200 map, 199 locs, 8 seconds to generate
Other Features (cont.) • Dynamic Point Costs – aka. Realistic intersections. Simplification: Medium Road Small Road Stop sign for the smaller road, no delay for the larger road Fast Highway Equal roads have an equal delay to pass (traffic light)Right turns 2x faster, Left turns 3x slower. If all-way stop sign (right), all turns are equal delay. Both roads travel fast through the intersection, as it is a system of exits. No delay.
Other Features (cont.) • Color-Coding – Different-sized roads have different colors. White -> Black on prior pictures, here’s a rainbow one.
Results • The “control” was a more basic version of my program, as such: • Intersections considered instantaneous • Cost to go from location to location = distance times speed limit of the road. • Basic A* heuristic
Results (cont.) • I ran 100 tests with the same random map (different each time) to go from a random place to a random other place. Each pixel ~ 125 feet 1 mile = 42 pixels
Conclusion • With all the added complexity (>50% slower searching and calculation), it is no wonder that commercial map searching programs don’t use point costs. • The improvement (up to 10% faster paths in very rare, short-distance cases) is not very useful, since at short distances the difference in travel times is usually less than a single minute
The Big Picture • My project is very expandable. Probably the best next step would be to add a learning heuristic, which will alter the heuristic based on results, in order to find the shortest path in the quickest way possible and make the search more efficient. This could improve the results to the point of usefulness; however, I believe that is unlikely.