On models and light bulbs
A nice little excerpt from Thomas Kühne’s “What is a model?“:
A Copy is not a Model
If I build a car according to an original being precise in every minute detail, I have not constructed a model but a copy. If I use the copy in a crash test, I have not performed a model simulation but a real test run. Copies neither offer the advantages of models (typically cost reduction) nor their disadvantages (typically inaccuracy with regard to the original).
For an example of an inaccurate model consider an electrician who frequently needs to work out which of several light bulbs in the attic is controlled by a particular switch on story below . The electrician is interested in walking the stairs as few times as possible and figures that bulbs and switches have “on” and “off” states and that all visits to the attic just need to generate a unique “on/off” sequence for each bulb so that it can be matched to the same “on/off” sequence of a switch. For three light bulbs one needs three different sequence which can only be generated with a minimum two visits. While this answer is true for the electrician’s model, it is not for reality. In reality the electrician can figure out the correspondence of three bulbs and switches with just one visit to the attic. Hint: The model dropped the fact that light bulbs not only emit light but heat as well and that it takes a while for a light bulb to completely cool down again…
Filed under: fun, modeling, paper | Leave a Comment
Evaluation of me as a TA
Last year I was a TA for two terms for the same undergrad course (CSC207 Software Design). I just received the student evaluations for my performance as a TA during the winter term, so now I have a clearer view of my performance during the whole year.
There were 9 and 8 evaluation responses during the Fall and Winter terms respectively, and the students gave me a mark from 1 to 7 inclusive, where 1 stands for extremely poor, 4 stands for adequate and 7 for outstanding. Here are my stats:
| Fall 2008 | Winter 2009 | |||
| mean | std dev | mean | std dev | |
| presentation | 2.33 | 1.41 | 4.38 | 1.51 |
| English | 3.67 | 1.41 | 5.12 | 1.55 |
| clarity | 2.44 | 1.67 | 5.00 | 1.07 |
| enthusiasm | 2.78 | 1.79 | 6.00 | 1.07 |
| question handling | 2.56 | 2.07 | 5.12 | 1.73 |
| grading fairness | 3.44 | 2.07 | 4.88 | 1.25 |
| grading speed | 3.67 | 1.94 | 4.62 | 1.69 |
| overall | 2.67 | 2.06 | 5.38 | 1.41 |
I think that the stats kind of tell the story of me coming and adapting to Canada. I came last September and for the first term, I really really sucked as a TA. But then, as I slowly became more and more accustomed to the place, the people, the language and the academic environment, things got much better.
I especially note the “enthusiasm” stat. It’s actually surprisingly accurate: the more I got accustomed to this place, the more I started identifying myself with it and regarding it as a place to which I want to contribute. I just feel sorry for the poor students that had to suffer me during my adaptation period…
Filed under: blogging, self-reference, teaching | Leave a Comment
Me wanna Xtext
(The funny part is that) I haven’t actually even touched Xtext yet, but I am utterly excited to participate to the Building DSLs with Xtext session at the coming Eclipse Modeling Day. I spent some time with Omar Badreddin at CASCON last week discussing, among other things, code generators and textual modeling and the like and Xtext came up at some point, sparking my interest for it.
But the thing that definitely changed my attitude from “hey this is interesting”, to the “ZOMFG I CAN’T WAIT!” electrifying nerdiness that I’m feeling right now was this fantastically interesting blog post by Sven Efftinge, on the usage of Xtext in the automotive industry (namely BMW). Do read.
(And in case you’re wandering, yes, that’s really Greek reggae and the band is called Locomondo)
Filed under: blogging, eclipse, events, fun, self-reference | Leave a Comment
Tags: Eclipse Modeling Day, xtext
Here’s an example of what can be done with Emfatic and EuGENia. The following annotated Ecore metamodel can be used to create a nice Statechart graphical editor.
Here’s the emfatic source:
@namespace(
uri="http://www.cs.toronto.edu",
prefix="statechart")
package statechart;
@gmf.diagram(model.extension="sm", diagram.extension="smd")
class StateMachine{
val State[*] states;
val Transition[*] transitions;
}
abstract class State {
ref NormalState[0..1]#submachine parentState;
}
@gmf.node(label="name", label.icon="false", figure="rounded", border.color="0,0,0")
class NormalState extends State{
attr String[1] name;
@gmf.compartment(collapsible="true")
val State[*]#parentState submachine;
}
@gmf.node(label="name", label.icon="false", figure="ellipse", color="0,0,0", border.color="0,0,0", size="1,1")
class InitialState extends State{
attr String[1] name="start";
}
@gmf.node(label="name", label.icon="false", figure="rectangle", color="0,0,0", border.color="0,0,0", size="1,1")
class FinalState extends State{
attr String[1] name="end";
}
@gmf.link(label="name", source="start", target="end", target.decoration="arrow", color="0,0,0")
class Transition{
attr String[1] name;
ref State[1] start;
ref State[1] end;
}
The diagram of the resulting Ecore model is (click to enlarge):
And once EuGENia has done its magic (instructions here), the resulting editor looks like this (again, click to enlarge):
Moreover, we can add EVL constraints to the metamodel and validate the resulting models according to them. This is a fairly simple example, but it goes a long way to demonstrate how easy it is to create things like this.
Filed under: diagrams, eclipse, fun, modeling | 3 Comments
Tags: EMF, Epsilon, EuGENia, GMF, Statecharts

