CS-351: Design of Large Programs
Computer Science Department
University of New Mexico
Fall 2008
|
|
Instructor:
Joel Castellanos
Department of Computer Science
e-mail: joel@unm.edu
phone: 505-277-7146
Office: Farris Engineering Center (FEC) 321
Building #119 in section I-2 of the
campus map.
Office hours (Spring 2009):
Mon & Wed: 10:30-11:30 AM
Tues & Thurs: 8:00-9:00 AM and by appointment
Syllabus
(updated Wed, 1/28/2009 turn-in policy and project 1’s due date)
Course Description
This class is about designing big software, where big refers to projects with a scope too large to be handled by any one person at any one time. This course primarily deals with software design, time management, and strategies for completing complex coding tasks.
Notes:
- Introduction
- Coding Standards
(updated Wed, 1/28/2009)
- Project 1: Digital Snowflakes Includes assignment for first milestone on last slides.
- SnowflakeDraw.java
(updated Sun, 2/22/2009, 3:20 PM: This version drops coloring by slop and edge. It colors only by height of the upper surface. It is the best so far for seeing how thick your crystals are). You may use the old version if you prefer. Also you may use your own version. Please include whichever version you use your turn in JAR.
- HexagonalPrism.java
- Point3i.java
- Point3f.java
- SnowflakeGui.java (updated 2/18: bug fix: isReset() now does not
always return false - it returns the state of the button at the time of the.)
When this class runs, it trys to open the image file ./bin/Resources/SnowflakeMorphologyDiagram.png.
where bin is the directory with the class files.
- SnowflakeMorphologyDiagram.png
- SnowflakeDraw.html
JavaDoc documentation of class SnowflakeDraw
- Multi Threaded Programming (updated Wed, 1/28/2009)
- ArrayList
- Digital Snowflake Project: Milestone II (updated detailing growth from generation 0 to generation 1.)
- Details of Java Object Passing
Digital Snowflake: The Final Generation
- Due date: February 22, 2009 11:59 PM.
- Read settings from the GUI, and use them to generate crystal growth. This includes pause,
reset and the temperature & saturation settings at the 8 vertices.
- Run your calculation intensive stuff in a separate thread so that the GUI remains responsive.
- Send an update of the growth to the drawing class every generation.
- Given a set of GUI settings, you should produce crystals that roughly correspond
to the state diagram.
- When all 8 corners have the same temp/saturation, your crystal should be very symmetrical.
- When the corners have different values, then asymmetries should develop with regional
areas of the snowflake developing in ways corresponding to the state diagram.
- When the temp/saturation changes during the growth process, then the growth patterns
of your crystal should change accordingly.
- Even when the user sets the sleep a long time, do not ever sleep more than .5 seconds without polling the GUI.
- Your stellar dendrites should be beautiful.
-
Be creative:
What is meant by this? There are many creative aspects of this project. Being creative is not a separate requirement. It is necessary to achieve the other requirements. For example, in milestone two, I specified the growth rates of some local geometric configurations. Doing nothing but experimenting with those numbers to discover forms that fit the snowflake state diagram is being creative. Deciding which additional local geometries you want to include (i.e. 0-4 faces or 0-1 faces) and deciding what growth numbers you want to use for them is being creative. There are many different sets of geometries and growth rates that will produce each of the patterns shown on the state diagram. Given two different sets of numbers that both produce simple columns, it does not matter which is used at (-35C, .8 g/m3). However, when averaging those values with the values in an adjacent state to find the growth rates at an intermediate temperature and saturation, the two sets of numbers that produce the same pattern at (-35C, .8 g/m3) will each produce something different. Which is better? Making this choice is being creative. Indeed, even choosing how you average growth rates for the intermediate temperature and saturation locations is being creative. Will you always pick the nearest 2, and use a weighted average based on the distance to each or will you pick the nearest 3 or 4? Will you use weights that are literary proportional to the distance or proportional to the square of the distance or something else? These decisions are not specified, and I do not even know which will give better results. Thus, these choices are creative. What do I even mean by “better results”? That too is a matter of interpretation. Fly, be free...
-
Grading:
Getting an A does not require producing for some masterpiece snow crystal that can be printed and posted in an art gallery.
Expected (grade of B): Your primary goal should be trying to make semi realistic looking snow crystals that match the given morphology diagram. If different parts of the snowflake are in different parts of the morphology, then those parts should be at least suggestive of the type of growth given there. If the snow crystal starts growing in one area of the state space, then growth is paused and the state space is changed to a different area, then a crystal should result that looks like it started growth in the one area and was moved to the other area.
Excellent (grade of A): The intermediate locations produce realistic or interesting results. Where interesting does not include crashing the Java Virtual Machine. The intermediate locations might produce crystals exhibiting some of the proprieties of neighboring defined locations, or they might produce some strange structures which may copy, predict or transcend reality.
- Snowflake State Diagram (morphology) by Professor Kenneth G. Libbrecht, Caltech
- Snowtypes.jpg by Professor Kenneth G. Libbrecht, Caltech
- Project 2: Genetic Algorithm
- Source Images
- Instructor's Solution to Milestone 1
- GeneticImageFrame.java
Main Class, JFrame, and contains subclass GenerationThread(). This class
instantiates ControlPanel() and two instances of GenericImagePanel() which
it places on its canvas. GeneticImageFrame() also instantiates
GA_RandomTriangles() and two instances of DNA: one for the current
generation and one for the previous.
- ControlPanel.java
GUI controls: buttons, sliders, etc.
- GeneticImagePanel.java
This class contains off-screen image buffers for drawing with double
buffering. It also contains a few static methods such as
loadImage() and calculateFitness()
- GA_RandomTriangles.java
This is a place holder for a genetic algorithm.
- DNA.java
This is the data structure of the DNA. It includes the subclass
Triangle() which is nothing more than int[10]. DNA includes a number
of useful public static final fields. It also includes public
methods such as setTriangleGeans(), getTriangleGeans, setLimits()
getLimits(), and addTriangle().
- Project 3: Traffic Simulation
Supplemental Reading:
- Unit Testing in Eclipse Using JUnit by Laurie Williams, Dright Ho, and Sarah Smith of North Carolina State University