Team:BCCS-Bristol/Modeling/HowBSimWorks

From 2009.igem.org

(Difference between revisions)
(A short tutorial)
Line 13: Line 13:
Here we present a short tutorial example which will walk you through the main steps of creating a simulation in BSim.
Here we present a short tutorial example which will walk you through the main steps of creating a simulation in BSim.
-
=== Example 1 -
+
=== Example 1 ===
-
 
+
-
 
+
-
 
+
== Concept - how BSim Simulations should work ==
== Concept - how BSim Simulations should work ==

Revision as of 12:29, 25 September 2009

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.

A short tutorial

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

Example 1

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()