|
From: Nick C. <ni...@sr...> - 2000-01-28 20:11:14
|
Hi, I moved the Repast CVS tree over to sourceforge this morning. It is available via the project page: http://http://sourceforge.net/project/?group_id=1703. In the future, I won't post CVS related news to repast-interest. Commit notifications etc. will go to repast-developer. The posted tree is identical to that in the 1.0 release except for one addition. Nelson Minar pointed out that the Schedule.scheduleAction methods that use reflection (i.e. all but those that schedule a BasicAction) are unecessary with static schedules, and an inner class can be used instead. HeatBugsModel.java reflects this change and I've included some snippets below. Instead of: displayGroup.createActionFor(dsurf, "updateDisplay") modelGroup.createActionFor(space, "diffuse"); modelGroup.createActionForEach(heatBugList, "step"); schedule.scheduleActionBeginning(0, modelGroup); schedule.scheduleActionBeginning(0, displayGroup); (The groups weren't really necessary here but I included them in the original source for illustration purposes). we now have: class HeatBugsRunner extends BasicAction { public void execute() { dsurf.updateDisplay(); space.diffuse(); for (int i = 0; i < heatBugList.size(); i++) { HeatBug bug = (HeatBug)heatBugList.get(i); bug.step(); } } }; schedule.scheduleActionBeginning(0, new HeatBugsRunner()); This avoids the use of the java.lang.reflect classes and will be faster over the course of a run. I'll be adapting the other demonstrations to use this idiom soon. Nick -- Nick Collier Social Science Research Computing University of Chicago ni...@sr... |