//////////////////////////////////////////////////////////////////////////// // // 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. // // // This example was devised by Rehana Rodrigues and refined by Kevin Oishi. include gro set ( "dt", 0.1 ); k1 := 0.001; // wave emit rate tr := 6; // refraction period td := 3.3; // detection time se := 100; // signal emit magnitude sd := 0.1; // signal detect threshold for wave st := 0.2; // signal detect threshold for edge detection ahl := signal (1,1); // This command declares a new signal // // The edge detection specification // program edge(k1,tr,td) := { rfp := 0; edge := false; r := [ t := tr ]; rate(k1) : { // randomly start a wave emit_signal ( ahl, se ) } r.t > tr & get_signal ( ahl ) > sd : { // propogate waves emit_signal ( ahl, se ), r.t := 0 } td-dt < r.t & r.t <= td : { // check edge condition edge := get_signal ( ahl ) < st } edge : { rfp := rfp + 1 } // report edge condition !edge & rfp > 0 : { rfp := rfp - 1 } true : { // for timing purposes r.t := r.t + dt } }; // associate the program with a cell ecoli ( [ x:= 0, y:= 0 ], program edge(k1, tr, td) );