cooperative pathfinding david silver. overview the problem solution methods local repair a*...

21
Cooperative Pathfinding David Silver

Upload: britney-studdard

Post on 15-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Cooperative Pathfinding

David Silver

Page 2: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Overview The problem Solution methods

Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical, Cooperative A*

Live demo (!?) Results

Page 3: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

The Problem N agents N goals Find N paths Such that no two

paths overlap

Page 4: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

The Problem with the Problem Search space is enormous

e.g. 100x100 gridworld ~(10,000)N states Branching factor of 5N

{N, E, S, W, wait} for each agent

Need to solve in real-time e.g. complete search within 1ms

Page 5: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Reformulating the Problem Err… isn’t this course called Single

Agent Search? So simplify the problem to a series

of single agent searches. Two approaches considered:

A* with local repair Cooperative A*

Page 6: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

1. A* with Local Repair Search for route to goal Ignore other agents If collision is imminent, route again Increase agitation level with each

reroute Cross fingers and hope for the best

Page 7: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Problems with Local Repair Failure to reach goal Long solution lengths Frequent recalculation Appearance of ‘stupidity’

Page 8: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

2. Cooperative A* Consider each agent in turn,

greedily Search for a route to goal, avoiding

reserved states Mark the agent’s route in a

reservation table Basic heuristic uses Manhattan

distance

Page 9: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Search Space The new search space has 3

dimensions 2 dimensional grid Time dimension

Reservation table marks illegal states Mark each state on any agent’s path Sparse data structure Implemented using hash table

Page 10: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Problems with Cooperative A* Poor heuristic, many nodes expanded

Need to improve heuristic Problems with agents at destination

Need to continue searching Sensitive to agent order

Dynamically rotate through agent orders

Page 11: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

How to improve the heuristic? Pattern databases no good

Search space too large Goal may be different each time Map may change dynamically

So use hierarchical A* (Holte) Search for goal at abstract level Use abstract distance as heuristic 3 ideas for reusing abstract search

Page 12: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

3. Hierarchical, Cooperative A* Domain abstraction

Ignore time dimension Ignore reservation table Basic gridworld search

Cooperative A* as before But using abstract distance as heuristic Abstract distance computed on

demand

Page 13: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Reverse, Resumable A* Search backwards from Goal Search towards Start But only terminate when requested

node is reached Keep Open, Closed lists Resume search whenever a new

node is requested Consistent heuristic required

Page 14: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

4. Windowed, Hierarchical, Cooperative A* Break up search into manageable

pieces Like an intermediate abstraction layer

Full search up to N steps Ignore time/reservations after N steps

After N steps this is the same as abstract layer

So use abstract distance to complete search

Page 15: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Windowing

S

G

N

window

abstract edged(N,G) = h(N,G)

Page 16: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Continuing the search Continue search after reaching

destination May need to get out of the way Use edge costs:

0 if sitting on destination 1 for other edges Abstract distance to goal for final

edge

Page 17: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Using Windows Compute window for all agents

initially Then recompute each agent when

half way through window Stagger computation to spread out

processing time Can keep abstract distances until

destination changes

Page 18: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Demo I hope this works!

Page 19: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Results: nodes expanded

0200400600800

100012001400160018002000

A* LRA* CA* HCA* W-32 W-16 W-8

BaseAbstract

Page 20: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Results: path length

0102030405060708090

100

A* LRA* CA* CHA* W-32 W-16 W-8

Length

Page 21: Cooperative Pathfinding David Silver. Overview The problem Solution methods Local repair A* Cooperative A* Hierarchical, Cooperative A* Windowed, Hierarchical,

Further ideas Additional layers in the hierarchy

e.g. ignore half the reservations Prioritising agents

Overriding low priority agents Abstracting in space as well as

time e.g. Using N-cliques