random map generation and pathfinding with dynamic point costs

18
Final Version Olex Ponomarenko

Upload: quinta

Post on 14-Jan-2016

36 views

Category:

Documents


2 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Random Map Generation and Pathfinding  with Dynamic Point Costs

Final Version

Olex Ponomarenko

Page 2: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 3: Random Map Generation and Pathfinding  with Dynamic Point Costs

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)

Page 4: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 5: Random Map Generation and Pathfinding  with Dynamic Point Costs

DEVELOPMENT

Page 6: Random Map Generation and Pathfinding  with Dynamic Point Costs

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.

Page 7: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 8: Random Map Generation and Pathfinding  with Dynamic Point Costs

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)

Second Quarter

• The RGG at this point was somewhat random – the following being a good example of the type of map it produces:

Page 9: Random Map Generation and Pathfinding  with Dynamic Point Costs

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)

Page 10: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 11: Random Map Generation and Pathfinding  with Dynamic Point Costs

750 x 750 map , 694 locs, 38 seconds to generate

Page 12: Random Map Generation and Pathfinding  with Dynamic Point Costs

Other Features (cont.)

• Dynamic Point Costs – aka. Realistic intersections. Simplification:

Fast Highway

Medium Road

Both roads travel fast through the intersection, as it is a system of exits. No delay.

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.

Stop sign for the smaller road, no delay for the larger road

Small Road

Page 13: Random Map Generation and Pathfinding  with Dynamic Point Costs

Other Features (cont.)• Color-Coding – Different-sized roads have

different colors. White -> Black on prior pictures, here’s a rainbow one.

Page 14: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 15: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Distance Between Points (in Pixels)

% of searches improved

<50 1%

51-120 12%

121-200 8%

201-300 8%

301+ 5%

Page 16: Random Map Generation and Pathfinding  with Dynamic Point Costs

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

Page 17: Random Map Generation and Pathfinding  with Dynamic Point Costs

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.

Page 18: Random Map Generation and Pathfinding  with Dynamic Point Costs