cs358 Lecture Notes Week 3, Thursday Model - View - Controller Pattern, part two. ------------------------------------------- In the previous example, the Controller was trivial. Just creates objects and waits. What if there is more than one view of the same object? Want: changes made in one view should be reflected in the other. Solution(s): Make every view aware of all the others. Use controller as liason between model and object. For every model method that modifies the model, the controller provides a "stub". The stub invokes the corresponding modifier, and then updates all views (probably by invoking the update method provided by each view). What is this modeling all about, anyway? --------------------------------------- Abstraction: replacing a complex system with a simplfied model. Concretization: taking a prediction from a model and applying it in the real world. 1) might be a specific prediction 2) might be a general rule Why? To make it possible to predict. How do you know which features you can omit and which ones are significant for making predictions? Which is better, a complicated model or a simple one? (and what do we mean by simple) Which is better, a realistic model or an unrealistic one? (and what do we mean by realistic) The most meaningful criterion is quality of prediction. Simplicity and realism are pleasant, but not necessary. Examples: economic assumptions about human behavior Jenn's project: claiming that a model that includes indirect interactions is better than a model that only considers direct interactions. Lake project: sensitivity analysis. Lots of parameters, some known better than others. If the model is very sensitive to one of the parameters that we don't know, then we have a problem. Venus project: need to keep adding features to the model until you see the phenomenon you are looking for. Working backwards in a sense: rather than making a prediction, you are looking for the simplest model (and parameters of that model) that explains the phenomena. Have to show not only that the model is more realistic, but that the predictions are significantly different (and preferably better). In the marketplace of ideas, the burden falls on the seller. Downey's semi-Popperian view of modeling ---------------------------------------- All knowledge about the world can be characterized as a model. Science advances by replacing models with better ones. Better means: 1) fewer free parameters (less ad hoc, more parsimonious) 2) able to explain more phenomena (more general) 3) more accurate predictions (based on known parameters, or insensitive to unknown ones) You can never know that your model is the Truth. This month's Scientific American -------------------------------- 1) double-gated transistors 2) Venus's climate: sinusoidal projection! 3) simple visualization: national divorce rates medical imaging: visible human project 4) origin of species: galapagos turles 5) open-source software 6) review of Richard Dawkins' new book, Unweaving the Rainbow 7) how the Zamboni machine works! Project reports --------------- Ostracod frontier calculation Venus model: momentum and simple harmonic motion