A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. The car was getting faster and faster,

Slides:



Advertisements
Similar presentations
CHAPTER 11 EXPRESSWAYS.
Advertisements

Sharing the Road Look for Motorcycles Motorcycles Motorcycles have the same privileges as other vehicles on the road. The chances of being involved.
Chapter 7 Negotiating Intersections
Chapter 10: Negotiating Intersections
Sample questions from the Rules of the Road units of the Driving Theory syllabus. ESOL for Driving.
Delaware State Driver’s Education Study Guide. Drivers have trouble seeing motorcycles in traffic. Why?
Intersections & Right of Way
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
6/13/20151 CS 160: Lecture 13 Professor John Canny Fall 2004.
1 Model View Controller. 2 Outline Review Definitions of MVC Why do we need it? Administiriva Changing the display Event flow Dragging at interactive.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Event-Driven Programming and Access Events
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-Oriented Analysis and Design
1 Object Oriented Design & Patterns Part 1. 2 Design Patterns Derived from architectural patterns: –rules for design of buildings –describe common problems,
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
Slides by Alex Mariakakis with material from Krysta Yousoufian and Kellen Donohue Section 8: Model-View-Controller.
Hazard Awareness and Vulnerable Road Users
Cycling Safely Nottinghamshire County Council. Safer Cycling It’s not a toy… Your bike is not a toy! When you ride your bike you are a ‘road user’. This.
1 Section III Day 2 DMV Manual p. 5-6, Write a scenario about how the driver of the white truck managed to keep his truck on the edge of the.
Right–of–Way Concepts
Unit 5 Intersections Judging Gaps Urban vs Rural Driving
1 BRIDGEPAD (BP) SYSTEM TRAINING Adapted for ScoreBridge Users By John de Ridder PSBC Revised 2 November 2009.
MVC pattern and implementation in java
Chapter 4. Your number one priority as a driver is to drive your vehicle carefully and safely. Your speed and manner of driving must create a safe environment.
MODULE 3 THE HAZARDS OF DRIVING.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
FireRMS NEMSIS (Part 2) Presented by Laura Small FireRMS Quality Assurance.
Drive Right Chapter 7 Negotiating Intersections Unit 4
Chapter 9 Driving in City Traffic More Complex!! Why? 1.Traffic is more dense – more cars, trucks, buses and pedestrians per mile than on rural roads.
GEMVC. The Setup Folders Views Value Objects (VOs) Custom Events Service CFCs Controller Model Application Main MXML.
Triggers and Stored Procedures in DB 1. Objectives Learn what triggers and stored procedures are Learn the benefits of using them Learn how DB2 implements.
Slides adapted from Alex Mariakakis, with material from Krysta Yousoufian and Kellen Donohue Section 8: Model-View-Controller.
Interacting With Other Users. Most collisions occur when two or more objects try to occupy the same space at the same time. Drivers must identify movement.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Computer Basics & Keyboarding. What Is A Computer? An electronic device operating under the control of instructions stored in its own memory unit An electronic.
Unit 4 Chapters 7, 9, 10 and 11.
Design Patterns -- Omkar. Introduction  When do we use design patterns  Uses of design patterns  Classification of design patterns  Creational design.
lesson 4.2 BASIC DRIVING MANEUVERS
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Intersections.
1 Cognitive Modeling GOMS, Keystroke Model Getting some details right!
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 12 Accessing.
© 2006 PSEN Unit - #4 Let’s Go Driving Identification Evaluation Control Monitor.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
3 Levels of Interaction Basic User Tasks Intermediate User Tasks Advanced User Tasks.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
CS320n –Visual Programming Execution Control with If / Else and Boolean Functions (Slides 6-2-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for.
Module 5 Terena Wibecka Lauren Megan Block 1X. Processing Information 1.A driver needs visibility, space, and time to safely operate a vehicle. 2.A vehicle.
Ch. 10: Negotiating Intersections
 Every sign’s shape and color have special meaning  Regulatory Signs: Signs that set limits, or give commands.  Example: stop sign, Yield, One Way,
1 Section III Day 2. 2 In this picture are a pedestrian, an inline skater, and a cyclist. They are all going the same way. Which roadway user has right.
The Simulation of Traffic Patterns and Optimizing Traffic Lights
Section 8: Model-View-Controller
Section 8: Model-View-Controller
Introduction to Events
A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. The car was getting faster and faster,
Chapter 12: Automated data collection methods
Signs and Symbols from Instant Art Traffic Signs CD-ROM
eTapestry Workshop Session 3: Queries and Reports
Tips to keep you safe while you are on the road…
Hazard Awareness and Vulnerable Road Users
Professor John Canny Spring 2004 March 5
Information Processing:
A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. Their car raced down the mountain, and.
MECH 3550 : Simulation & Visualization
Professor John Canny Spring 2003 March 12
lesson 4.2 BASIC DRIVING MANEUVERS
Presentation transcript:

A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. The car was getting faster and faster, they were struggling to get round the corners and once or twice only the feeble crash barrier saved them from crashing down the side of the mountain. They were sure they were all going to die, when suddenly they spotted an escape lane. They pulled into the escape lane and came safely to a halt.

The physicist said "We need to model the friction in the brake pads and the resultant temperature rise, see if we can work out why they failed". The engineer said "I think I've got a few wrenches in the back. I'll take a look and see if I can work out what's wrong". The programmer said "Why don't we try again and see if it's reproducible?"

Slides adapted from Alex Mariakakis with material from Krysta Yousoufian, Kellen Donohue, and James Fogarty Section 8: Model-View-Controller

 The classic design pattern  Used for data-driven user applications  Such apps juggle several tasks:  Loading and storing the data – getting it in/out of storage on request  Constructing the user interface – what the user sees  Interpreting user actions – deciding whether to modify the UI or data  These tasks are largely independent of each other  Model, view, and controller each get one task

talks to data source to retrieve and store data Which database table is the requested data stored in? What SQL query will get me the data I need?

asks model for data and presents it in a user-friendly format Would this text look better blue or red? In the bottom corner or front and center? Should these items go in a dropdown list or radio buttons?

listens for the user to change data or state in the UI, notifying the model or view accordingly The user just clicked the “hide details” button. I better tell the view. The user just changed the event details. I better let the model know to update the data.

 Organization of code  Maintainable, easy to find what you need  Ease of development  Build and test components independently  Flexibility  Swap out views for different presentations of the same data (ex: calendar daily, weekly, or monthly view)  Swap out models to change data storage without affecting user

ModelViewController

 In theory…  Pattern of behavior in response to inputs (controller) are independent of visual geometry (view)  Controller contacts view to interpret what input events should mean in the context of the view  In practice…  View and controller are so intertwined that they almost always occur in matched pairs (ex: command line interface)  Many architectures combine the two

ModelViewController

ModelViewController

 Push architecture  As soon as the model changes, it notifies all of the views  Pull architecture  When a view needs to be updated, it asks the model for new data

 Advantages for push  Guaranteed to have latest data in case something goes wrong later on  Advantages for pull  Avoid unnecessary updates, not nearly as intensive on the view

ComponentModelViewController Detect cars waiting to enter intersection Traffic lights to direct car traffic Regulate valid traffic movements Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval X X X X X X X

 Model  Stores current state of traffic flow  Knows current direction of traffic  Capable of skipping a light cycle  Stores whether there are cars and/or pedestrians waiting  View  Conveys information to cars and pedestrians in a specific direction  Controller  Aware of model’s current direction  Triggers methods to notify model that state should change

 Model  TrafficModel – keeps track of which lights should be on and off  View  CarLight – shows relevant state of TrafficModel to cars  PedestrianLight – shows relevant state of TrafficModel to pedestrians  Controller  PedestrianButton – notifies TrafficModel that there is a pedestrian waiting  CarDetector – notifies TrafficModel that there is a car waiting  LightSwitch – enables or disables the light  Timer – regulates time in some way, possibly to skip cycles

 Apply your generic graph & Dijkstra’s to campus map data  Given a list of buildings and walking paths  Produce routes from one building to another on the walking paths

 List of buildings (abbreviation, name, loc in pixels) BAG Bagley Hall (East Entrance) , BGR By George ,  List of paths (endpoint 1, endpoint 2, dist in feet) , , : , : ,1956.5: , , : , : , :  (0,0) is in the upper left

 Model stores graph, performs Dijkstra’s  View shows results to users in text format  Controller takes user commands and uses view to show results  View and Controller will change in HW9, but Model will stay the same