160 likes | 358 Views
Predator Prey. Robert Lass May 27 th , 2010 Robot Lab. Final Project: Predator Prey. What is the problem; What are the steps to solving the problem; What are some ways to solve each of the steps; Where to look for more help. Predator Prey. Five predators; Four prey;
E N D
Predator Prey Robert Lass May 27th, 2010 Robot Lab
Final Project: Predator Prey • What is the problem; • What are the steps to solving the problem; • What are some ways to solve each of the steps; • Where to look for more help.
Predator Prey • Five predators; • Four prey; • Predators must coordinate to find and capture prey; • Demonstrates coordination / cooperation.
What are the pieces of this problem? • Finding prey; • Tracking prey; • Coordinating tasks among predators; • “Carcass detection”
Finding Prey • Coordinated Search; • Robots can divide up the map to search more quickly; • When four robots are capturing a prey, perhaps the fifth could search for more prey?
Tracking Prey • Prey has been located: • Prey move; • Need to track prey or they will need to be found again; • Need to follow them in order to capture them. • Suggestion: • Track the prey, moving towards the assigned location (NSEW). • When they prey stop, should be able to capture them.
Problems in Common • Both finding and capturing prey have the same problems: • Multiple predators; • Problem can be divided into pieces; • One way to handle this is a task assignment algorithm; • Many ways to do this, I will cover one of them: the Hungarian algorithm.
Hungarian Algorithm • Also called Munkres algorithm; • Was first published in 1890s, but was ignored and independently rediscovered in the 1950s • Can run as fast as O(N^3), depending on implementation; • Demonstrate on board.
Implementation Issues • Number of rows and columns is not equal: • Add dummy rows or columns. • Decentralized, who should compute the assignments? • Centralize the problem; • Everyone computes the solution. • Problem is changing; • Recompute “frequently.” • Robots may have disjoint views. • Recomputing may help here too.
Other Approaches • Local search technique, such as DSA; • Simple Distributed Improvement Algorithm; • Both are described in the first paper link on the project website;
DSA Taken from “Distributed Stochastic Search for Constraint Satisfaction and Optimization: Parallelism, Phase Transitions, and Performance” by Zhang, et al
Carcass Detection • Artifact of Player Stage: • Robots cannot be removed from the simulation online (or can they?!); • When a prey is captured, need to record the location of its body; • Use this to prevent robots from finding and capturing the same prey multiple times. • Use numLivingPreys() to help if you want.
Extra Credit, Extra Troubles • Come up with an approach to handle message latency and message loss. • Wiki specifies latency of 5 seconds and 25% probability of message loss. • Why is this hard? • You don’t know if other robots have the same information; • You know other robots do not have up to date information; • Latency is almost as long as the prey stop for.
Ideas • Solve the problem faster; • Use a more random approach: • Everyone does what they think is best (ignore communications); • Execute a pre-defined plan, even if it’s suboptimal. • Come up with your own ideas!
Disclaimer • I am human. • Please let me know if there are problems with the code. • Sometimes the prey “leave” the world. (PS bug?) • Just drag them back in.