220 likes | 355 Vues
Catch Me If You Can. Group 20 B94902027 鍾政達 B94902067 陳建男 B94902080 何雨帆. Rules of the Game. Two agents playing human and ghost respectively The ghost agent’s goal is to catch the human agent The human agent’s goal is to avoid being caught by the ghost in a round. The Environment.
E N D
Catch Me If You Can Group 20B94902027鍾政達 B94902067陳建男 B94902080何雨帆
Rules of the Game • Two agents playing human and ghost respectively • The ghost agent’s goal is to catch the human agent • The human agent’s goal is to avoid being caught by the ghost in a round
The Environment • The map will be an 39x39 bitmap input • Human is in the lowerright corner at the beginning • Ghost is in the upper left corner at the beginning
The Strategy: Human (Ver.1) • Construct a heuristic to define the “degree of danger” of each node • When ghost appears, plan an escaping route base on the heuristic • After we reached the goal, if the ghost is not in sight, keep rotating and scan
State Diagram (Ver.1) Rotating Scan Route Planning Ghost Insight Goal Reached Walking
The Heuristic Function Heuristic(x, y) = DegreeOfDanger(x, y) = Combine((DistanceToGhost(x, y), Compact (x, y))
Definition of Compactness • Check the 7x7 array centered by (x, y) • Sum up the number of those bits that are black (obstacle)
Combination of Distance & Compactness • Naïve wayDanger = Compact – k * Distance • Our way 400 – Compact Compact Danger = ─────── + ───── 10 * Distance 4 What is this!?
Why Bother? • Compact + Near • Empty + Near • Compact + Far • Empty + Far *The ranges between these four statuses should equal to each other
Refinement 1: Rotating State Full speed of ghost & human are similar • Turning becomes a deterministic point • Human should avoid turning as much as it can • The “Rotating Scan” state becomes a vulnerable point!
Refinement 2: Keep Walking The sight of pioneer 3DX robot is narrow • It is likely that the ghost is chasing us but we dose not notice • Staying at the same point do no good • Keep walking!
Moving Method • Avoid Collision • Adjust Velocity • No Rotate + Keep Walking = Drift
Drift: No Rotate • Search 10 nodes away from our current position base on the direction on the map • Check if there are any obsticles between the node and us • Pick the farrest node as the “short goal” and go staight toward it
Drift: Keep Walking • Update the short goal by watch dog (we may never reach the short goal) • Change the speed of both wheels to adjust the direction while forwarding
State Diagram (Ver.2) Build up the Compactness Map Build up the Ghost Map Plan Route Build up the NextGoal Map On Its Way To the Goal Ghost Insight Goal Reached
Refinement 3: Ghost Insight If the ghost is too close to us • Rotate becomes time wasting • Two kinds of “Ghost Insight”: Near & Far • Changes the direction while moving!
Ghost Insight & Near Dash Route 1 Dash Route 2
State Diagram (Final Version) Build up the CompactMap Build up the Ghost Map Plan Route Build up the NextGoalMap On Its Way To the Goal Dash Ghost: Far Goal Reached Ghost: Near Ghost Insight
The End Thanks for your attention