\ Simple 3D biofilm experiment corresponding to C simulations

new-experiment  64 by 64 by 64 space

load step-rend-vert.fth

\.

Development of biofilms is broken up into two phases: a growth
phase, and a food-mixing phase.

.\

\* All bits have the same interpretation in the growth and in the
food-mixing phases, except for the child+ and child- bits: visibility
and connectivity are only computed during mixing (we display at the end of
the mixing step).  Bacteria only produce children (which diffuse)
during the growth step. *\

\*  food-mixing  *\

 0  0 == visibility                
 1  1 == connected
 2  3 == bacteria
 4  5 == food         4  4 == food+  5  5 == food- 
 6  7 == boundary
 8  9 == conn         8  8 == conn+  9  9 == conn-
10 10 == eat
11 11 == die
12 12 == mix
13 13 == feed
14 14 == spawn

\* growth (same as above, except...) *\

 0  1 == child+
 8  9 == child-


\* Boundary conditions *\

0 constant no-boundary
1 constant food-source
2 constant substrate


\* Simulation parameters (fraction denominator is 10,000) *\

  35 constant child-diffuse-period   \ four diffuse steps per period
  35 constant food-diffuse-period    \ four diffuse steps per period

   7 constant eat-fraction
 100 constant die-fraction
5000 constant mix-fraction
5000 constant feed-fraction
 830 constant spawn-fraction
1000 constant seed-fraction
5000 constant food-fraction

\* Variables *\

0 constant axis
1 constant dir

: -dir dir negate ;

load film-growth.part
load film-mix.part
load film-init.part


: film-step

        random 2 mod {{ birth+death-step0 birth+death-step1 }}
        child-diffusion
        food-fill-step  food-init-step
        10 0 do food-step loop  detach-step
;

this is update-step

\* Colormap *\

3 constant food-max

: film-map

        bacteria 0<> >green
        food bright * food-max / >blue
        boundary 0<> >red
        boundary food-source = if bright >green then
;
colormap film-map

Init-cells show

