top imageSwarm Chemistry Homepage

Hiroki Sayama, D.Sc.
sayama AT binghamton DOT edu
Last updated: 7/29/2018

[News] [About] [Simulator] [Recipes] [Publications]

Swarm Chemistry Simulator Applet: Version 1.3.0 (3-D)
Watch Evolutionary Swarm Chemistry Videos on YouTube

§ What's New?

Past Updates


§ About Swarm Chemistry

"Swarm Chemistry" is interactive simulation software developed and used for the author's research project on the collective dynamics of heterogeneous self-propelled particle swarms. Swarm agents (a.k.a. particles) steer their motion according to a set of simple kinetic rules, similar to those in Craig Reynolds' "Boids". Each agent in our model has its own kinetic parameters that may be different from others, so that you can mix several different types of swarm agents into a single population and see how they kinetically react and self-organize into a dynamic pattern.

For more detail of the project and the computational swarm model we use, see Publications.


§ Swarm Chemistry Simulator

Evolutionary Version (released on 7/28/2015)

In response to some requests, I am releasing the codes of the simulator that was used to generate some of the evolutionary swarm videos posted to the YouTube channel. It will generate a series of JPEG images. Please have a look at README.txt for more details. Let me know if you generate neat evolution of swarms.


Non-Evolutionary Version

Currnet Release: Version 1.3.0 (3-D, new version) / Version 1.2.0 (2-D, original version)

With the Swarm Chemistry simulator, you can explore the dynamics of Swarm Chemistry through an interactive evolutionary method. A monitor of 1024x768 or higher resolution is recommended.

This simulator was written in Java as a hybrid program that can run as either a stand-alone application or an applet launched from a web browser. To run the simulator, you will need Java Runtime Environment (JRE) 6.0 (also called 1.6.0) or later version, which is available for free from the Sun Microsystems website. The web browsers tested for the applet include Mozilla Firefox 9.0 and Google Chrome 16.0, both on Windows XP. Any suggestions or bug reports will be appreciated.

Note: This simulator is developed and distributed in the hope that it will work correctly and be useful, but WITH ABSOLUTELY NO WARRANTY. You may not use either this simulator or the results obtained through the use of this simulator for any commercial purposes without permission of the author. You may use, distribute or modify this simulator without permission of the author for academic purposes, as long as its original sources are included and fully credited in all the derived distributions.

  1. How to start
    There are three different ways to get the Swarm Chemistry simulator running on your computer:

    1. Simply launch it as a Java applet.
      Click here to launch the new Swarm Chemistry 1.3.0 (3-D) simulator applet
      Click here to launch the old Swarm Chemistry 1.2.0 (2-D) simulator applet

    2. Download the JAR file and launch it as a Java application.
      Click here to download the new JAR file "SwarmChemistry-1.3.0.jar"
      Click here to download the old JAR file "SwarmChemistry-1.2.0.jar"
      Then do "java -jar SwarmChemistry-1.3.0.jar" (or "... -1.2.0.jar") in your local terminal. In many environments, just double-clicking on the jar file also works.

    3. (For experienced users) Download the source codes, re-compile them, and run. To compile Java codes you will need Java SE Development Kit (JDK) 6.0 or above.
      Click here to download the new source codes "SwarmChemistry-1.3.0-src.tar.gz"
      Click here to download the old source codes "SwarmChemistry-1.2.0-src.tar.gz"
      A typical sequence of commands needed would be:
      • "tar zxvf SwarmChemistry-1.3.0-src.tar.gz"
      • "javac SwarmChemistry.java"
      • "java SwarmChemistry"

    Can't use javac or java in Windows? Try this web page.

  2. How to stop
    To stop the simulator, close the rectangular control window shown at the top of the screen by clicking on the "Quit" button.

  3. How to play
    The Swarm Chemistry simulator, shown in Fig. 1(a), adopts what we call hyperinteractive evolutionary computation (HIEC), by which you can interactively add (b), mutate (c), mix (d), replicate (e) and edit (Fig. 2) swarm populations according to your preference. If you double click on one swarm, its mutated copy will be created nearby. If you click on two swarms, their mixture will be created between them. The positions and sizes of windows will be adjusted automatically.

    HIEC

    Figure 1: How the Swarm Chemistry interactive simulator works

    You can also look at the actual kinetic parameter settings and their compositions of each swarm population, called "recipe", by either right-clicking on the window of your interest or clicking on its "Edit" menu (Fig. 2). This pop-up window tells you how many agents within the swarm have what kind of kinetic parameter values. See Publications for the detailed meanings and acceptable ranges of these parameters. You can also edit the recipe in the text area and then click on "Apply edits" to reflect your edits to the original simulation window to which the recipe window belongs (this operation is not possible with an orphaned recipe window whose simulation window was closed already).


    recipe
    Figure 2: Recipe window


§ Sample Recipes

[Note: 1/18/2012] Now you can embed live swarms in your own web page!! Simply include the following code in your HTML source, with the "value" of the "recipe" parameter changed to your own recipe. Setting the "tracking" value to "on" will enable the automatic zoom feature.

<table><tr><td><applet width="300" height="300" codebase="http://bingweb.binghamton.edu/~sayama/SwarmChemistry" archive="SwarmChemistrySimulatorApplet.jar" code="SwarmChemistrySimulatorApplet.class">
<param name="recipe" value="48 * (150.39, 15.89, 23.54, 0.74, 0.45, 62.65, 0.33, 0.13) 152 * (217.14, 12.13, 12.42, 0.59, 0.98, 14.06, 0.04, 0.65) 14 * (248.54, 5.85, 22.26, 0.43, 0.11, 17.14, 0.06, 0.68) 31 * (141.53, 2.91, 4.86, 0.92, 0.03, 21.87, 0.28, 0.2)"/>
<param name="tracking" value="off"/>
</applet></td></tr><tr><td align=center><a href="http://bingweb.binghamton.edu/~sayama/SwarmChemistry/">What's this?</a></td></tr></table>
Sample

Here are some sample recipes that produce interesting patterns and behaviors. Copy and paste the recipes into the simulator's recipe window and watch what happens. (NOTE: Copy & paste may not work properly on recent online Java applets. If this problem happens, download the .jar file above and run it as a local application instead.)

If you developed an interesting pattern/behavior, please take a copy of its recipe and email it to the author so that it will be added here!

Uzushio (New!)
49 * (184.07, 12.64, 38.49, 0.67, 0.31, 63.78, 0.11, 0.21)
67 * (177.92, 15.66, 11.05, 0.85, 0.41, 51.77, 0.09, 0.86)
58 * (177.92, 15.66, 11.05, 0.85, 0.41, 51.77, 0.03, 0.86)
10 * (298.48, 0.65, 19.27, 0.84, 0.11, 83.18, 0.24, 0.5)
37 * (81.6, 18.34, 27.3, 0.94, 0.17, 3.41, 0.2, 0.9)
1 * (274.4, 3.33, 7.42, 0.9, 0.19, 7.37, 0.43, 0.17)
12 * (203.64, 3.33, 7.42, 0.9, 0.19, 7.37, 0.43, 0.17)

Contributed by Taku Tsuzuki

Insurmountable Wall
42 * (52.57, 9.91, 20.42, 0.32, 0.76, 1.8, 0.01, 0.64)
25 * (84.87, 8.82, 24.98, 0.91, 0.44, 40.97, 0.18, 0.6)
45 * (220.42, 4.65, 7.53, 0.96, 0.35, 46.18, 0.25, 1.0)
49 * (279.64, 10.29, 35.95, 0.37, 0.49, 38.09, 0.32, 0.89)

Contributed by BE-461 students (2010)

Cell with Two Nuclei
41 * (249.84, 4.85, 28.73, 0.34, 0.45, 14.44, 0.09, 0.82)
26 * (277.87, 15.02, 35.48, 0.68, 0.05, 82.96, 0.46, 0.9)
30 * (277.87, 15.02, 24.44, 0.68, 0.05, 82.96, 0.43, 0.9)
28 * (110.8, 16.12, 38.6, 0.18, 0.34, 14.3, 0.01, 0.01)
48 * (83.79, 13.29, 7.54, 0.08, 0.79, 1.07, 0.15, 0.45)
74 * (269.64, 6.62, 34.69, 0.36, 0.5, 30.2, 0.03, 0.23)

Contributed by BE-461 students (2011)

Multicellularity
99 * (19.8, 15.73, 2.61, 0.85, 0.64, 10.51, 0.17, 0.06)
48 * (300.0, 14.63, 0.0, 0.48, 0.81, 90.27, 0.25, 0.78)
37 * (275.18, 16.9, 7.05, 0.48, 0.81, 90.27, 0.17, 0.85)
8 * (159.59, 2.09, 24.19, 0.96, 0.59, 76.03, 0.01, 0.07)
42 * (73.07, 1.82, 2.36, 0.27, 0.61, 40.55, 0.22, 0.86)

Contributed by BE-461 students (2011)

Jelly Fish
134 * (262.65, 12.01, 25.87, 0.97, 1.0, 56.35, 0.26, 0.61)
67 * (288.17, 6.19, 23.37, 0.95, 1.0, 1.31, 0.1, 0.9)
68 * (150.5, 12.97, 15.87, 0.46, 0.39, 57.95, 0.17, 0.48)

No, Wait - This Way
60 * (262.68, 2.82, 38.32, 0.21, 0.01, 54.93, 0.11, 0.19)
40 * (78.58, 5.7, 33.23, 0.89, 0.18, 45.44, 0.04, 0.05)
40 * (257.27, 14.96, 35.66, 0.2, 0.8, 47.81, 0.13, 0.13)

Contributed by Lucas Sabalka

Recombining Blobs
132 * (45.91, 10.82, 21.11, 0.86, 0.13, 42.48, 0.32, 0.74)
84 * (113.26, 3.41, 25.71, 0.4, 0.39, 49.53, 0.13, 0.24)

Contributed by Lucas Sabalka

Playing Catch
76 * (84.06, 0.09, 9.89, 0.33, 0.32, 15.66, 0.22, 0.68)
100 * (158.86, 18.4, 24.98, 0.3, 0.3, 1.72, 0.06, 0.37)

Contributed by Matt Hoffman

Pulsating Eye
102 * (293.86, 17.06, 38.3, 0.81, 0.05, 0.83, 0.2, 0.9)
124 * (226.18, 19.27, 24.57, 0.95, 0.84, 13.09, 0.07, 0.8)
74 * (49.98, 8.44, 4.39, 0.92, 0.14, 96.92, 0.13, 0.51)

Contributed by Benjamin Bush

Chaos Cells
144 * (109.03, 6.71, 12.7, 0.47, 0.6, 61.43, 0.02, 0.21)
89 * (117.15, 16.33, 31.88, 0.39, 0.13, 12.96, 0.48, 0.8)
67 * (76.3, 8.59, 26.57, 0.7, 0.64, 28.39, 0.3, 0.35)

Contributed by Jesse Fagan

Aggressive Predator
18 * (211.92, 12.59, 19.37, 0.09, 0.21, 57.92, 0.0, 0.95)
41 * (257.27, 14.96, 35.66, 0.2, 0.8, 47.81, 0.13, 0.13)
35 * (262.68, 2.82, 38.32, 0.21, 0.01, 54.93, 0.11, 0.19)
31 * (78.58, 5.7, 33.23, 0.89, 0.18, 45.44, 0.04, 0.05)
7 * (194.21, 12.88, 21.68, 0.97, 0.19, 99.21, 0.5, 0.13)

Contributed by Dave Manger

Fast Walker & Slow Follower
67 * (216.35, 11.75, 7.7, 0.83, 0.97, 97.31, 0.02, 0.38)
29 * (254.64, 7.28, 7.0, 0.95, 0.11, 22.41, 0.43, 0.31)
13 * (105.4, 3.55, 5.24, 0.34, 0.18, 23.53, 0.39, 0.24)

Swinger
48 * (150.39, 15.89, 23.54, 0.74, 0.45, 62.65, 0.33, 0.13)
152 * (217.14, 12.13, 12.42, 0.59, 0.98, 14.06, 0.04, 0.65)
14 * (248.54, 5.85, 22.26, 0.43, 0.11, 17.14, 0.06, 0.68)
31 * (141.53, 2.91, 4.86, 0.92, 0.03, 21.87, 0.28, 0.2)
Rotary
29 * (122.13, 19.19, 17.98, 0.65, 0.44, 19.88, 0.46, 0.2)
51 * (299.13, 0.79, 38.71, 0.25, 0.18, 86.49, 0.38, 0.43)
10 * (252.92, 19.99, 10.21, 0.23, 0.17, 1.22, 0.28, 0.92)
Wedding Ring
24 * (220.51, 13.88, 3.47, 0.46, 0.38, 6.23, 0.19, 0.68)
13 * (64.07, 1.4, 19.7, 0.88, 0.27, 0.36, 0.47, 0.72)
35 * (117.53, 7.31, 21.72, 0.3, 0.5, 98.69, 0.03, 0.29)
Turbulent Runner
131 * (177.1, 9.71, 30.06, 0.8, 0.43, 19.65, 0.45, 0.91)
169 * (277.3, 14.67, 37.71, 0.68, 0.23, 77.01, 0.02, 0.31)
Blobs
300 * (20.8, 1.95, 20.75, 0.95, 0.99, 9.31, 0.05, 0.68)

Linear Oscillator
133 * (214.41, 17.93, 35.14, 0.64, 0.13, 0.29, 0.08, 0.97)
24 * (253.6, 7.19, 15.51, 0.82, 0.33, 32.65, 0.34, 0.56)


§ Publications


Comments, questions and suggestions are welcome.
Copyright © 2006-2018 by Hiroki Sayama. All rights reserved.
sayama AT binghamton DOT edu