//////////////////////////////////////////////////////////////////////////// // // 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. // // // Coded by Andrea Samoré include gro set ("dt",0.05); // Short range signal definition SR := signal (0.3,1); // Long range signal definition LR := signal (3,0.5); program g1() := { // Initialization rfp := 0; gfp := 0; p :=[state := 0, thSR := 1, thLR := 0.5]; // RFP degradation rate(0.05*rfp) : {rfp := rfp-1}; // Switch with a certain probability from the undecided state to the leader state if the long range signal is below a specified threshold (p.state = 0) & rate(0.01) & (get_signal(LR) < p.thLR) : { p.state := 1; }; // Once in the leader state, emit the two signals, decrease the growth rate and become green (p.state = 1) : { emit_signal (SR,70); emit_signal (LR,100); set ("ecoli_growth_rate",0.001); gfp := 100; }; // If in the undecided state and the short range signal emitted by a leader is above a certain threshold then switch to the "red" state (p.state = 0) & ( get_signal (SR) > p.thSR ) : { p.state := 3; }; // In the "red" state the cell produces rfp. It gets out of the "red" state if the short range signal emitted by the leader is below a certain threshold (p.state = 3) : { rfp := rfp + 1; p.state := if ( get_signal (SR) < p.thSR) then 0 else 3 end; }; }; program report() := { needs rfp; selected : { message(1,tostring(id) <> " rfp: " <> tostring(rfp) <> " SR:" <> tostring(get_signal(SR)) <> " LR:" <> tostring(get_signal(LR))) }; }; program p() := g1() + report() sharing gfp,rfp; ecoli([x := 0,y:=0], program p()); start();