Swarm: applications
(Difference between revisions)
m (→Java) |
(→How to run example applications) |
||
| Line 7: | Line 7: | ||
For newcomers, [[Examples_of_Swarm_applications|here is a peek at a couple of classic Swarm applications]]. | For newcomers, [[Examples_of_Swarm_applications|here is a peek at a couple of classic Swarm applications]]. | ||
| − | ==How to run example applications== | + | ==How to choose and run example applications== |
| + | |||
| + | ===Objective-C or Java?=== | ||
| + | You need to decide whether you will write your Swarm programs using Objective-C or Java. Aside from obvious points (such as the fact that you might already be more familiar with one of the languages), here are the pros and cons of the two languages: | ||
| + | |||
| + | *In the world of software development, at least one hundred times as much programming is done in Java as in Objective-C. So you'll find more people and books that can help you with Java than with Objective-C. You'll also find more third-party libraries so, for example, if your model is three-dimensional, you might choose to abandon Swarm's visual interface (which uses TCL) in favor of Java's Java3D technology. | ||
| + | |||
| + | *Java was created much later than Objective-C, and presumably takes advantage of the advances in language design that occurred after Objective-C was created. | ||
| + | |||
| + | *Probably more Swarm programs have been written in Objective-C than in Java, so there are more Swarm-specific programming models in Objective-C than in Java. On the other hand, given the size of the universe of all individual-based models that anyone might like to program in Swarm, unless you know of a relevant existing model right now, you're not likely to find anything more useful than the standard Swarm demos available in both languages. | ||
| + | |||
| + | *If one language is faster at run time, it's likely to be Objective-C. However, the difference is likely to be slight. You should not accept claims about speed without seeing a relevant benchmark. Try googling ''benchmark java objective-c''. | ||
| + | |||
| + | *Since the Java interface to the Swarm engine is generated automatically, identical functionality is available in both languages. Thus functionality would never be a reason for choosing one language over the other. | ||
| + | |||
Listed below are sites where you can download Swarm models. To run them: | Listed below are sites where you can download Swarm models. To run them: | ||
| Line 17: | Line 31: | ||
*A common problem is not having your system's SWARMHOME environment variable correctly pointed to the location of your Swarm installation. SWARMHOME should typically be /usr/local/ or /usr/ if you've installed it from a binary package on a GNU/Linux system. For Windows, see [[Windows_binary_notes]] | *A common problem is not having your system's SWARMHOME environment variable correctly pointed to the location of your Swarm installation. SWARMHOME should typically be /usr/local/ or /usr/ if you've installed it from a binary package on a GNU/Linux system. For Windows, see [[Windows_binary_notes]] | ||
| − | ===Java=== | + | ===Java applications=== |
| − | We provide [[instructions]] for running the Java program Jheatbugs-3.0 on Windows XP using Swarm 2.2. | + | We provide explicit [[instructions]] for running the Java program Jheatbugs-3.0 on Windows XP using Swarm 2.2. Other programs are also available in Java. |
==Official applications archive== | ==Official applications archive== | ||
Revision as of 01:52, 23 March 2006
We make a wide variety of Swarm models available. These illustrate the many different kinds of research questions addressed using agent-based models, and provide example ideas and software for other modelers.
Contents |
Demo page
For newcomers, here is a peek at a couple of classic Swarm applications.
How to choose and run example applications
Objective-C or Java?
You need to decide whether you will write your Swarm programs using Objective-C or Java. Aside from obvious points (such as the fact that you might already be more familiar with one of the languages), here are the pros and cons of the two languages:
- In the world of software development, at least one hundred times as much programming is done in Java as in Objective-C. So you'll find more people and books that can help you with Java than with Objective-C. You'll also find more third-party libraries so, for example, if your model is three-dimensional, you might choose to abandon Swarm's visual interface (which uses TCL) in favor of Java's Java3D technology.
- Java was created much later than Objective-C, and presumably takes advantage of the advances in language design that occurred after Objective-C was created.
- Probably more Swarm programs have been written in Objective-C than in Java, so there are more Swarm-specific programming models in Objective-C than in Java. On the other hand, given the size of the universe of all individual-based models that anyone might like to program in Swarm, unless you know of a relevant existing model right now, you're not likely to find anything more useful than the standard Swarm demos available in both languages.
- If one language is faster at run time, it's likely to be Objective-C. However, the difference is likely to be slight. You should not accept claims about speed without seeing a relevant benchmark. Try googling benchmark java objective-c.
- Since the Java interface to the Swarm engine is generated automatically, identical functionality is available in both languages. Thus functionality would never be a reason for choosing one language over the other.
Listed below are sites where you can download Swarm models. To run them:
Objective-C applications
- Download and un-zip the archive. The archives are usually in TAR GZIP format (e.g., HeatBugs.tar.gz), which you can unzip (in a Linux terminal window or, if using Windows, in Cygwin) by typing "tar xzvf HeatBugs.tar.gz".
- Change directories into the newly unzipped directory of source code.
- If your Swarm installation is set up correctly, you can then compile the application by simply typing "make".
- If compilation is successful, you will have a new executable file (e.g., "heatbugs.exe" in Windows; "heatbugs" in Linux). Then you can start the model by typing "./heatbugs.exe" (or, in Linux, "./heatbugs").
- A common problem is not having your system's SWARMHOME environment variable correctly pointed to the location of your Swarm installation. SWARMHOME should typically be /usr/local/ or /usr/ if you've installed it from a binary package on a GNU/Linux system. For Windows, see Windows_binary_notes
Java applications
We provide explicit instructions for running the Java program Jheatbugs-3.0 on Windows XP using Swarm 2.2. Other programs are also available in Java.
Official applications archive
Our official archive of Swarm applications is at http://ftp.swarm.org/pub/swarm/apps/. Even though these models are generally old, many of them still work in Swarm 2.2. There are far more Objective-C than Java applications in the archive.
The archive includes Java versions of the Swarm classics heatbugs and mousetrap. The versions that worked with Swarm-2.1.1 and Swarm-2.2 are currently available in the testing subdirectory of the ftp archive. Look for jheatbugs-2001-03-28.tar.gz and jmousetrap-2001-09-13.tar.gz.
We strongly encourage people to contribute new applications! The site includes a form for describing contributions.
Paul Johnson's package of Objective-C applications
Paul Johnson has generously assembled a new package of applications for Swarm-2.2. This is a revised version, correcting a couple of glitches in saving of screen snapshots. It is available from Paul's web site: http://www.ku.edu/~pauljohn/Swarm/swarmapps-objc-2.2-2.tar.gz and also at the Swarm download site: http://ftp.swarm.org/pub/swarm/apps/objc/sdg/swarmapps-objc-2.2-2.tar.gz. Please keep testing and let Paul know how it works.
The package contains classic example Swarm applications, including:
- The Swarm tutorial (discussed in the Swarm User Guide)
- Heatbugs
- Mousetrap
- ArborgamesII (a simulation of forests used in publications by M. Savage et al.)
- SchellingII (Schelling's neighborhood segregation model)
- Conway (the Game of Life)
- sss (Swarm Sugar Scape).
We are soliciting volunteers who want to maintain some 'orphaned' applications from swarmapps-2.1.1. These apps that need love and attention are market, template, and hello-world. If you are interested in taking on one of those applications, or offering up other applications, contact PJ.
Additional links
- The world-famous Artificial Stock Market has its own homepage at http://artstkmkt.sourceforge.net (Objective-C)
- Paul Johnson keeps many examples of Swarm-related code, his own models, and other people's models, at: http://www.ku.edu/~pauljohn/Swarm/
- Keep your eye on the Agent-based modeling community pages for projects using Swarm.
- See the software resources at the ABM Resources area of the wiki for a series of template models in Java and Objective-C Swarm, and for guidance on using Swarm with integrated development environments.
![[Main Page]](/stylesheets/images/wiki.png)
