//////////////////////////////////////////////////////////////////////////// // // gro // // Copyright (c) 2011-2012 Eric Klavins, University of Washington // For more information, email klavins@uw.edu // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // include gro s := signal ( 1, 0.1 ); program p() := { set ( "ecoli_growth_rate", 0.0 ); m1 := 0; m2 := 0; t := 0; mode := 0; t > 0.25 : { t := 0, m1 := m2, m2 := get_signal(s) } mode = 0 : { run ( 1 ) } mode = 1 : { tumble ( 100 ) } mode = 0 & m2 < m1 & rate ( 0.5 ) : { mode := 1 } mode = 0 & m2 > m1 & rate ( 0.01 ) : { mode := 1 } mode = 1 & rate ( 0.01 ) : { mode := 0 } true : { t := t + dt } }; program main() := { true : { set_signal ( s, 0, 0, 100 ) } }; foreach q in range 100 do ecoli ( [ x := rand(600)-300, y := rand(600)-300, theta := 0.01*rand(628) ], program p() ) end;