1 / 7

The Dog and the Mailman

The Dog and the Mailman. Project 1. Simulate Mailmen and Dogs. Dog sees mailman Mailman sees dog Mailman runs from dog Dog runs to bite mailman (or get is dog biscuits) When does dog get mailman?. Dog Details. Dog always moves towards mailman No “heading him off at the pass” Type 1 dog

Télécharger la présentation

The Dog and the Mailman

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Dog and the Mailman Project 1

  2. Simulate Mailmen and Dogs • Dog sees mailman • Mailman sees dog • Mailman runs from dog • Dog runs to bite mailman (or get is dog biscuits) • When does dog get mailman?

  3. Dog Details • Dog always moves towards mailman • No “heading him off at the pass” • Type 1 dog • Moves a 2t for first 5 seconds • Moves at 10 for rest of time • Type 2 dog • Moves at 3t for first 4 seconds • Moves at 12 for rest of time • May slips! (See included function)

  4. Mailman Details • Runs in straight line (x > 0) • No confusing dog with zig-zag • No spraying dog with mace • Has shoe untied at time 0 (should have bought velcro!) • Type-A mailman • Ties shoe for 5 seconds then runs at speed 5 • Type-B mailman • Runs immediately with shoe untied at speed 2.5

  5. Your Task • Write simulation to determine when each dog bites the mailman • Four cases • Which dog is fastest? Should the mailman tie his shoe? Should the mailman find another job? • The type-2 dog randomly slips, so you will need multiple runs (at least 10)

  6. Hints • Seed random number generator • “man srandom” • Maybe use time() (“man 2 time”) • Can use other language (C++, Java, Perl…) • Draw graphs! (showing data or x,y coordinates) • Gnuplot • Excel

  7. Hand-In • Report • Description of your model • High-level algorithm • Termination and starting conditions • Rule(s) used to update simulation • Conclusion on: • Whether or not the mailman should tie his shoe • Which type of dog is better at catching mailmen • Source code • Send by email

More Related