Team:BCCS-Bristol/Modeling/HowBSimWorks

From 2009.igem.org

Revision as of 12:56, 25 September 2009 by Amaty (Talk | contribs)

BCCS-Bristol
iGEM 2009

Contents

How BSim works

In this section we discuss the new structure of BSim simulations and the improvements made in how they are specified. We present a walkthrough of creating a fully-featured simulation of hundreds of bacteria exhibiting a classic run-and-tumble motion. All examples presented here are included with the BSim 2.0 distribution (To be uploaded soon...).

The new structure

When we set out to restructure BSim it was decided that it should be made much more versatile and adaptable, and that as much as possible of the physics and coding should effectively be behind the scenes. This would allow stronger focus on the biological aspects of the simulation. To this end BSim has now been rebuilt as an environment where the user takes various functionalities already in place and uses them to create a simulation tailored to their specific requirements.

The creation of a BSim simulation requires a basic working knowledge of the Java programming language. However as stated above, in designing the new structure of the BSim environment we have endeavoured to provide a toolkit that would also be useful to people without a programming background. The BSim distribution will include complete documentation for all available functions, and numerous example simulations showcasing the available features.

Comprehensive and complete Java documentation can be found on the Sun Website, including a number of tutorial trails. However for help on a specific function it is often easier to perform an internet search for "Java" followed by the name of the function.

A short tutorial

Here we present two short tutorial examples which will walk you through the main steps of creating a simulation in BSim.

Example 1 - Super Simple Simulation

Concept - how BSim Simulations should work

Moved to end temporarily - do we still want this here?

scene.particles.add(
  new Bacterium(position: 0 1 0, radius: 1),
  new Bacterium(position: 0 1 0, radius: 1),
  new Bacterium(position: 0 1 0, radius: 1),
  new Bead(position: 0 1 0),
);

b = new Bacterium()
b.grn(new GRN(dy/dx = -2x; dx/dz = y^2))
scene.particles.add(b);

scene.chemicalFields.add(
  new ChemicalField(chemical: aspartate),
  new ChemicalField(chemical: AHL)
)

scene.boundaries(..)
scene.dt(..)
scene.simulationTime(..)

app.renderer(new ProcessingRenderer())
app.exporters.add(
  new FileExporter(),
  new MovieExporter(),
  new ScreenshotExporter()
)
app.gui()