Sometimes, although the model installs successfully from the standalone installer setup.jar file, the displays refuse to behave correctly. We observed the following odd behaviors in standalone runtime models on some Windows machines:

  • Charts (data visualizations) and Displays (geography objects) did not initially render upon model initialization (“initialize” or “play” seemed to work, but nothing was displayed in the main panel).
  • Charts were only displayed when the model was paused and then restarted.
  • When paused and restarted, the model would display two charts — one chart completely blank, and the other showing the expected data.  Every single chart would be doubled.
  • No matter what, the GIS display would not render.

To a large extent, this behavior seemed to be determined by whether the machine running the standalone model also already had the Repast development environment installed.  If the machine had the development environment installed, the displays almost always showed up properly; if the machine had only a Java JRE and not Repast, the displays were missing or repeated (and the GIS map wouldn’t appear at all).

We asked at the Repast-interest listserv in case someone knew of a solution (or if not, to alert the developers of a potentially new bug).  Nick Collier suggested on the basis of the missing GIS map display that the problem may be that Repast requires the Java Advanced Imaging libraries to be installed. He linked the Sun website’s 1.1.2 release, but the installer didn’t play well with the first test machine.  Instructions for installing Java Advanced Imaging libraries from elsewhere on the internet resulted in total success, however!  And that was that, problem solved.

Two Repast lessons here:

  1. Make sure to test standalone installations on machines without the Repast development environment installed.
  2. If you have odd display issues using Repast, make sure that Java Advanced Imaging (JAI) is installed, with .jars to jre/lib/ext and .dlls to jre/bin.

NOTE: The model would produce the error below, but only after the model was paused and then restarted (without pausing and restarting, no charts were created that could even generate an error):

2010/08/16 11:19:55,510: Error while creating displays
java.lang.IllegalArgumentException: Duplicate AttributeTypes DefaultAttributeType [name=__sele_cted__ , type=class java.lang.Boolean , nillable=true, min=1, max=1]
at org.geotools.feature.FeatureTypeBuilder.check(FeatureTypeBuilder.java:600)
at org.geotools.feature.FeatureTypeBuilder.addType(FeatureTypeBuilder.java:347)
at org.geotools.feature.FeatureTypeBuilder.addTypes(FeatureTypeBuilder.java:327)
at repast.simphony.space.gis.FeatureAgentFactory.getFeatureType(FeatureAgentFactory.java:169)
...

(This problem and its solution are also documented in the Repast-interest thread; they are repeated here for more recorded detail in the hope that more Googleable buzzwords might bring you to a solution faster….)