While Java enables its users to create interactive applets and make them publicly available in their web pages, it is still a programming language that requires expertise that usually only professional programmers possess and is neither available to nor desirable for end-users. End-users are people who typically do not care about the notion of programming per se; still, they would like to have an increased sense of control over computers and be able to create artifacts, such as interactive Java applets, that traditionally could only have been created by professional programmers. We claim that in behavior processing (the kind of programming the occurs in AgentSheets), Java should be at the level that Postscript is in word processing. When users create a document in word processing and want to print it out, they just push a button that does exactly that. It is of little or no interest to them that, in order to be printed, the document is first translated into Postscript and sent to a printer where a Postscript interpreter creates the printed version. Just as users of word processors do not have to learn Postscript to print their document, end-users in behavior processing should not have to learn Java to create an applet out of their simulations.
Recently, some "instant" Java tools that "claim to put Java applet creation within reach of everyone" were developed (Venditto, 1997). However, these tools are usually limited to parameter manipulations that allow the users to change existing applets in various ways, such as set foreground and background colors and fonts. Even though this is an important step towards end-user creation of applets, we believe that there should be tools that take this idea even further by allowing end-users to create their own applets from scratch. AgentSheets provides the Ristretto generator [12] layer (Repenning and Ioannidou, 1997) to allow end-users to create Java applets out of their simulations, without having to learn Java, or even worry about its existence.
Referring to our scenario in the previous section, suppose Beth created a Fish Tank simulation in AgentSheets in which fish swim around and sharks eat fish. It would probably be impossible for her to create the same simulation as a Java applet for Beth to include in her homepage. In fact, it would probably take one or two days, for a professional programmer to achieve this. With Ristretto, however, this process becomes a matter of minutes for end-users as well as more sophisticated users. Once the users are happy with their simulation, by pressing a single button, Ristretto generates a complete Java applet that can be embedded in web pages and then be accessed remotely through the internet by other users. In just a few seconds, Ristretto compiles every agent behavior directly into Java class files consisting of Java byte codes and compiles agents depictions into GIF files. Translating agent rules directly into Java bytecode results in very efficient applets because the only run-time interpretation left is in the Java virtual machine.
Figure 33: Fish Tank applet generated with Ristretto agent-to-Java-byte-code generator.
Interactive example 1: The Fish Tank.
Requires a browser which supports Java.
Beth makes her entire simulation to be accessible to other users. All she has to do is to press the Ristretto button in order to turn her Fish Tank including her modified divers into a Java applet [13] (Figure 33). The applet created is ready to run on a large number of different Java runtime support environments, including Netscape Navigator, MS Internet Explorer, JDK Applet Runner, and MRJ Apple Applet Runner, allowing the simulation generated to be used on a wide range of hardware platforms.
The Ristretto-generated applet allows its users to edit the simulation world. Users can add and remove agents (in the fish tank: water, ground, rocks, small fish, waves, caves, sharks, and weeds), can start and stop the simulation, and can change the speed at which the simulation is running. Furthermore, the Ristretto-generated applet can be controlled through JavaScript or interact with other applets through inter-applet Java functions.
Interactive example 2: Pascal's and Leibniz's Adding Machine.
Requires a browser which supports Java.