The Dog and the Mailman - PowerPoint PPT Presentation

About This Presentation
Title:

The Dog and the Mailman

Description:

Dog runs to bite mailman (or get is dog biscuits) When does dog get mailman? Dog Details ... Moves a 2t for first 5 seconds. Moves at 10 for rest of time. Type 2 dog ... – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 8
Provided by: clay2
Learn more at: http://web.cs.wpi.edu
Category:
Tags: biscuits | dog | mailman

less

Transcript and Presenter's Notes

Title: The Dog and the Mailman


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 gt 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
Write a Comment
User Comments (0)
About PowerShow.com