Last article showed how we could use Processing with Eclipse and Java 1.5. Heady with success, I decided to try to convert the near-trivial RandBoxes Processing demo to Jython.
Why?? Well, our group uses Blender quite a bit, and Blender uses Python as its scripting language. More generally, Python is quite popular within our scientific community.
Jython, a Python implementation using the JVM, has been surprisingly successful, having most of what we like about CPython. And its Java integration made it a natural for Processing. This presentation is a good overview.
read more..
We at Redfish have been using Processing.org’s graphics system for models requiring fairly sophisticated 3D capabilities. Here’s an example prototype of the Pittsburgh PNC Baseball Stadium done with Processing. (Note: Our Redfish site has more information on the project page.
Processing is more than a graphics library, it has a delightful IDE which makes Java much easier, especially for the Java novice. The IDE has great tools such as a web-page builder with the project as an applet. It also can build an application version for Mac, Windows and Linux.
One difficulty we faced however, was that we wanted to commit to fairly complicated models that would benefit from Java 1.5 (Processing uses an earlier version) and an IDE familiar to Java programmers. We also are interested in interfacing Java to other languages such as Groovy, Python/Jython, Ruby/JRuby, and even JavaScript/Rhino.
So I decided to experiment with Processing, using Eclipse and Java 1.5. To do this, I made two models: RandBoxes, which is really simple .. just showing 1000 boxes and randomly jiggling them each step. The second model, RoadGrid, is more complicated: it draws a rectangular road grid and has “cars” (rectangles) moving along the roads. At each intersection, the cars randomly chose a new road segment.
read more..
Last year, Nick Thompson, Professor of Psychology and Ethology of Clark University, dropped by Santa Fe on Sabbatical. Nick brought with him a puzzle relating to the Prisoner's Dilemma.
The core idea of the Prisoner's Dilemma is a game where two folks choose to cooperate or not (defect). The scoring is such that if you cooperate and your opponent defects, you (the "sucker") get quite a low score. If you both cooperate, however, you get a reasonable score but not as high as a defector gets against a cooperator. This classic in game theory poses the paradox that your best move is to defect, even though if you both defect, you both get a very poor score. Grim.
Robert Axelrod was puzzled by this, and suggested that if the game were repeated (iterated), the best outcome would could vary according to the strategy of the players. This resulted in his now famous computer tournament pairing strategies against one another. The sweet result was that a firm but friendly strategy, Tit for Tat, which cooperated initially, then simply repeated the opponent's previous move from then on, was the overall winner.
Nick, looking at this, thought that it'd be nuts to stay in a series of Prisoner's Dilemma games if the opponent was clearly no fun to work with. Thus he introduced the idea of leaving the tournament. MOTH, My way Or The Highway, builds a new suite of strategies which have the additional capability of leaving an unpleasant encounter. This creates a pool of strategies without partners, so they are re-paired randomly, and the tournament continues.
The result is that Nick, along with several of our local Friam group here in Santa Fe, worked on a NetLogo model exploring this new approach. This model expanded upon and validated earlier work done by Nick and his colleagues David Joyce and John Kennison. This resulted in a paper delivered to the Lake Arrowhead Conference on Human Complex Systems.
The NetLogo Model we created is viewable by you, gentle reader. The explanation provided with the model presents considerable detail about the ideas behind the Moth strategy.
Not surprisingly, a quite successful strategy is a variation of Tit for Tat: play Tit for Tat and on the first defection by your opponent, leave the tournament to be paired with a (hopefully!) more cooperative player!
A friend of mine, Michelle Aden, recently asked me to write about some aspect of Open Source for a conference on that topic. It occurred to me that research had recently enjoyed becoming part of the Open Source community, so I looked into writing about that.
Here is the resulting paper. It's also available in PDF and Word format.
I should note that considerable editorial help came from Sherrie Bolin, making it a much cleaner read!
Comment [1]
While updating my ancent website (started in the 1995’s .. so very html 1.0), I decided to look into the current state of the art of web publishing.
Imagine my surprise when I found that the cruddy table based mess the .com sites used to achieve their unnatural, pixel perfect goals had been replaced by a very clean separation of content and structure (xhtml) and the looks and style of the page (css).
I put together several examples for a talk to our local technical team. Here’s the talk’s “slides” .. pages of reference material and demos.
Note: The talk included considerable CSS magic by making simple changes in the style sheet using CSSEdit and having immediate response in the preview page. So some of that is missing for folks just looking at these pages.
Here we look at old html and new xhtml and css.
These folks, and many others, brought order back from the chaos of the early, table-centric (read “Gawd Awful”) mess our poor web wandered into. Notice how design played a strong role in achieving this revolution. Techies — be humbled.
Note: During this part, I used the very simple document discussed above, simply changing its style sheet. Between step 1 and 2 I added a bit more material to show the impact of the styling.
Here’s the tip of the help iceburg. My recent experiences converting to xhtml/css and then Textpattern as a CMS really made me appreciate all the help out there. Angels, we thank you!