Marine Biology Simulation Case Study Alyce Brady Kalamazoo College.

Slides:



Advertisements
Similar presentations
Chapter 6: Arrays Java Software Solutions for AP* Computer Science
Advertisements

CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
Data Structures, Lists, and Trees CS-2301 B-term Data Structures — Lists and Trees CS-2301, System Programming for Non-majors (Slides include materials.
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
Module 1 Unit 2 Project: writing an advice letter --By Zhou Zhenghu No
AP ® Marine Biology Simulation Case Study Alyce Brady Kalamazoo College.
ACM/JETT Workshop - August 4-5, Marine Biology Case Study (MBCS) A Discussion.
AP ® Marine Biology Simulation Case Study Alyce Brady Kalamazoo College.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Chapter 3 List Stacks and Queues. Data Structures Data structure is a representation of data and the operations allowed on that data. Data structure is.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
07 Coding Conventions. 2 Demonstrate Developing Local Variables Describe Separating Public and Private Members during Declaration Explore Using System.exit.
More on “The Huddersfield Method” A lightweight, pattern-driven method based on SSM, Domain Driven Design and Naked Objects.
Data structures and algorithms in the collection framework 1 Part 2.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
111 © 2002, Cisco Systems, Inc. All rights reserved.
1 Java: AP Curriculum Focus and Java Subset Alyce Brady.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
AP ® Marine Biology Simulation Case Study Alyce Brady Kalamazoo College.
1 Heaps and Priority Queues Starring: Min Heap Co-Starring: Max Heap.
Object-Oriented Analysis and Design Fall 2009.
Testing and Debugging Session 9 LBSC 790 / INFM 718B Building the Human-Computer Interface.
HIT2037- HIT6037 Software Development in Java 22 – Data Structures and Introduction.
Unit Testing Maintaining Quality. How do you test? Testing to date…
Marine Biology Simulation Part II: Assignment, Milestone 1 Dung “Zung” Nguyen Mathias Ricken Stephen Wong TeachJava 2004! June 25, 2004.
Alyce Brady, Kalamazoo College Software Engineering Friday, Week 4.
Qualitative Research Topic : Analysis is Ongoing (P.272~290) MA1C0109 Owen 楊勝雄.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Nifty Assignments: Marine Biology Simulation OOPSLA ‘04 Educators’ Symposium October 25, 2004 Eric Cheng Mathias Ricken Dung “Zung” Nguyen Stephen Wong.
Week 8 - Wednesday.  What did we talk about last time?  Level order traversal  BST delete  2-3 trees.
1 Heaps and Priority Queues v2 Starring: Min Heap Co-Starring: Max Heap.
Teaching with the AP ® Marine Biology Simulation Case Study Materials mostly from: Alyce Brady(Case Study Author) Kathy Larson(Case Study Teachers' Guide.
Teaching with the AP ® Marine Biology Simulation Case Study Materials mostly from: Alyce Brady(Case Study Author) Kathy Larson(Case Study Teachers' Guide.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Lesson 6 – Libraries & APIs Libraries & APIs. Objective: We will explore how to take advantage of the huge number of pre-made classes provided with Java.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
(c) , University of Washington18a-1 CSC 143 Java Searching and Recursion N&H Chapters 13, 17.
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
Aquarium Lab Series Developed by Alyce BradyAlyce Brady of Kalamazoo CollegeKalamazoo College.
Slides prepared by Rose Williams, Binghamton University Chapter 16 Collections and Iterators.
Object Orientated Programming in Perl Simulated Models of Termites.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
COMP 103 Course Review. 2 Menu  A final word on hash collisions in Open Addressing / Probing  Course Summary  What we have covered  What you should.
Teach.NET Workshop Series Track 4: AP Computer Science with.NET and J#
Teaching with the AP® Marine Biology Simulation Case Study
AP Case Study Overview Barbara Ericson Jan 2005
Victorian Curriculum Mathematics F - 6 Algorithms unplugged
More Sophisticated Behavior
Analysis and Comparison is ICS4U
DDC 2423 DATA STRUCTURE Main text:
Chapter 1 OBJECT-ORIENTED ANALYSIS AND DESIGN
Week 15 – Monday CS221.
Interfaces and Inheritance
structures and their relationships." - Linus Torvalds
Graph Paper Programming
Nifty Assignments: Marine Biology Simulation
Introduction to Computer Science for Majors II
Marine Biology Simulation Part III: Assignment, Milestone 2
CS 350 – Software Design Principles and Strategies – Chapter 14
Learning Areas Levels Objectives Software Description Author
Marine Biology Simulation Part II: Assignment, Milestone 1
structures and their relationships." - Linus Torvalds
Presentation transcript:

Marine Biology Simulation Case Study Alyce Brady Kalamazoo College

Case Study as Educational Tool n describes a real situation n provides an interesting example from which to draw certain lessons n provides a context for comparing theoretical ideas against real-world experience

Case Studies in AP CS n try to give the illusion of being a real-world situation (MBCS) or real-world tool (BigInt) n must be simplified and cleaned-up enough to be readable and understandable for HS students

Benefits of an AP CS case study n example of a largish program n opportunity to discuss tradeoffs (design, performance issues, readability, etc) n example of good coding, design, and documentation practice n approximation of master/apprentice n rich source of assignments n source of non-trivial exam questions

Alyce’s Additions n describe the development or modification of a program, not just a finished product n cover design n cover testing

Goals for Java MBS n provide benefits described in prev. slides n be similar to C++ MBCS u u teachers can pick it up faster u u can use it as they learn Java n be different from C++ MBCS u highlight differences in language u highlight differences in curriculum

The Story n A CS student, Pat, gets a summer job working for marine biologists. n Hired to enhance an existing program that simulates fish movement in a bounded environment. u Needs to understand existing program u Designs, codes, and tests modifications n Occasionally Pat turns to an experienced programmer, Jamie, for help. n Narrative is Pat’s report of summer job.

The Package n Code for the “existing” program u Source for core classes u Jar files for “black box” & GUI classes n Javadoc documentation for most classes n Data Files n Instructions for compiling/running n Narrative (pdf file)

The Modules (Chapters) n Experiment with existing program n Guided tour of existing program by Jamie n Add breeding and dying n Add two new kinds of fish (inheritance) n Provide alternative representations (unbounded environment, others)

First Day on the Job n “[The program] was designed to help the marine biologists study fish movement in a bounded environment, such as a lake or a bay.” n Jamie available the next day. n Given instructions for running it and told where to find data files. Chapter 1

Guided Tour n “The biologists think of the environment as a rectangular grid, with fish moving from cell to cell in the grid. Each cell contains zero or one fish.” Chapter 2

What classes are necessary? To model fish swimming in a bounded environment, the program has Fish objects and an Environment object. To model fish swimming in a bounded environment, the program has Fish objects and an Environment object. The purpose of the program is to simulate fish moving in the environment, so the program also has a Simulation object. The purpose of the program is to simulate fish moving in the environment, so the program also has a Simulation object. n There are other useful, but less important "utility classes." Chapter 2

One step in the simulation Chapter 2

What do core classes look like? n Simulation: almost identical to C++ MBCS n Environment: black box; only look at class documentation (think header file!) n Fish: u has color, direction  move method is a little more complicated, has more helper methods Chapter 2

move method Get next location to move to (call nextLocation ) Get next location to move to (call nextLocation ) n If next location is different from this location,  move there (call changeLocation )  change direction (call changeDirection ) Chapter 2

nextLocation method Get list of empty neighboring locations (call emptyNeighbors ) Get list of empty neighboring locations (call emptyNeighbors ) n Remove location behind fish from list n If there are any empty neighbors left, randomly choose one; otherwise return current location Chapter 2

Breeding and Dying n Problem Specification: A fish should... u have a 1 in 7 chance of breeding, u breed into all empty neighboring locations, u attempt to move when it does not breed, u never move backwards, and u have a 1 in 5 chance of dying after it has bred or moved. Chapter 3

Breeding and Dying Pseudo-code for act method if this is the 1 in 7 chance of breeding if this is the 1 in 7 chance of breeding call the breed method call the breed method else else call the move method call the move method if this is the 1 in 5 chance of dying if this is the 1 in 5 chance of dying call the die method call the die method Chapter 3

Breeding and Dying n Test Plan u Testing random behavior (Chap 2) u Black-box testing u Code-based testing Chapter 3

Specialized Fish n Different patterns of movement  Darters ( DarterFish )  Slow fish ( SlowFish ) n Inheritance n Dynamic Binding Chapter 4

Specialized Fish DarterFish DarterFish u darts two cells forward if possible u or darts one cell forward u or reverses direction (without moving) Chapter 4

Specialized Fish SlowFish SlowFish u has only a 1 in 5 chance of moving out of current cell  otherwise movement is the same as Fish Chapter 4

Classes for A Exam n Class Implementations  Simulation  Fish (as modified in Chapter 3)  DarterFish  SlowFish n Class Documentation u A number of utility classes

Environment Implementations n Multiple environment implementations u Environment Interface u Bounded: 2D array (matrix) -- existing u Unbounded: ArrayList of Fish -- Pat develops this implementation Chapter 5

Environment Implementations n Exercises u Very large bounded environment (list or sparse matrix) u Sorted list for unbounded environment with binary search u BST for unbounded environment u Hash map for unbounded environment Chapter 5

Classes for AB Exam n Classes and documentation from A Exam n Additional Class Interfaces/Implementations  Environment  BoundedEnv  UnboundedEnv n Class Documentation u One new utility class

Key Features n Overall design & core classes are similar n Discussion of modification/development allows focus on design and testing n Highlights new/different language features n Highlights new topics in curriculum u Inheritance, dynamic binding u Interfaces

Want to use it? n compsci/download.html