University of Virginia | CS Department at UVA | Swarm programming @ CS @ UVA

Cell Simulator 1.2 Documentation

Getting Started

This document contains the following sections
  1. Features
  2. Installation
  3. Running Cell Programs
  4. Writing Cell programs
  5. Writing models for CellSim

Conventions: Anything in [] is optional, Anything in <> is obligatory, Anything within "" must be typed as is


  1. An architecture that allows dynamically loading a simulation using user-defined models for
    1. Cell program
    2. Cell Model
    3. System Model
  2. A sim / config file will load these into a simulation object by reading a file with contents
  3. Better UI to allow simultaneous viewing of several simulations (at different stages)
  4. Arcitecure allows easy specification of diffferent statistics


  1. Extract the file to C:\cellsim\. If you install to a different path be sure to edit the init_env file present in the cellsim main directory to reflect your new path.
  2. Install J2SDK from [Ver 1.4.1]
  3. Install Java3D also from filename should be java3d-1_3-windows-i586-opengl-sdk.exe for OpenGL version for the i586
  4. Install JavaCC (2.1) from
    Note: This is not needed for running CellSim

All 3 are also available at

Running Cell Cell Programs

The applet can be viewed once (1) & (2) are installed. The applet is available at
The stand-alone version of CellSim is available at

cd CellSim
(init_env is a batch file that sets the paths. You may need to modify it for your installation)
java gui.GUI

Select File->New and then Simulation->Step. Using the menu File->New, you can run as many simulations as you like in seperate internal windows within the main window

Writing your own cell programs

  1. It is better to draw a diagram of the cell state transitions as this will give a better idea of the control flow.
  2. Check the BNF for the CPA Grammar here.
  3. You can write your own cell program grammars by adding modules to the parsers directory. The next section describes how this can be done.

Writing your own models for CellSim

  1. The abstract classes SystemModel, Cell and Parser reside in the core/ subdirectory and form the heart of the Cell Simulator. These must be subclassed to form different models for the system, cell and the parser
  2. The class Simulation dynamically loads the models specified in the SIM file for the SystemModel, Cell and Parser
  3. To create your own system model, I suggest that you begin by creating a copy of the subdirectory sysmodels/simplebiology. Store it as sysmodels/MySystemModel. Rename the class-names and the package-name in sysmodels/MySystemModel/ suitably. The heart of the model is the function
    public Vector provideService(Vector args)
    It is basically a function called by the Cell to cause system-wide effects like chemical diffusion, cell diffusion etc
  4. You can similarly create a new Cell model by starting with cellmodels/SimpleCell/ Again begin by modifying the provideService() function
  5. Be sure to create a sim file similar to simple.sim provided in the main directory of the CellSim distribution. Also make sure that the classes for your new models are reacheable through the CLASSPATH. As long as you keep all cell models in the cellmodels/ folder, all system models in the sysmodels/ folder and all parsers in the parsers/ folder and name the packages using the pathname from the base directory, this should not be a problem

swarm University of Virginia
Department of Computer Science
Programming the Swarm
Sponsored by the National Science Foundation
David Evans
Selvin George