|
From: Nick C. <vze...@ve...> - 2001-12-09 23:56:41
|
Hi, I wanted to add a demo model that used SimpleModel as a base class to the RePast distribution. So, I implemented Conway's life. SimpleModel is really suited for this as the same thing happens every tick and the model divides up nicely into an "execution" and post-execution phase. The canonical implementation takes place on an "infinite" space, but I used a torus. You still get gliders, guns, etc., but obviously the longer term dynamics are different. If there's time, I'll do an "infinite" space version, if only so I can muck up the space package a bit more :). Its in CVS so feel free to update and take a look. As part of implementing Life, I made some important changes to ListPropertyDescriptor and the reflector package in general. For those that don't know the reflector package handles probing, that is, the display of an object's properties and the gui manipulation of them. Previously, the gui widgets responsible for editing the properties returned the edited value as String. This String was then transformed appropriately and passed as the argument to some set method. This was fine for primitives and Strings, but made it difficult to "edit" objects. I changed the Widget interface to return an Object rather than a String and added some new code to invoke the set method with an Object argument. This impacts all areas of probing. I ran some tests, and everything seems okay, but let me know if there are any problems. The point of doing this was to allow named Objects in ListPropertyDescriptors. In the case of Life, the Objects are setup objects for initializing the grid. You chose the name of the initial grid pattern and this sets the setup object. Then this SetUp object's setup method gets called when the model is setup. (Whew! That's a lot of setup). Lastly, in making the evolver distribution last week, I moved some stuff out of the rscript package. The result is that a fresh update and compile from scratch from CVS won't work. I'll remove the rscript directory tomorrow, and that should fix the problem. Nick -- Nick Collier Social Science Research Computing University of Chicago http://repast.sourceforge.net |