1212# we want initialisation to be identical across all processes
1313#randomSeed(1)
1414
15+ replicate = sys .argv [1 ] if len (sys .argv )>= 2 else 1
16+
1517# we want the array operations to have a different seed across processes
1618array_urand .seed (int (1024 * random ()))
1719
@@ -33,7 +35,7 @@ def av(x):
3335#mut_max=float(sys.argv[3]) # mutation rate
3436#migration=float(sys.argv[4]) # initial migration rate
3537
36- print ("Area, Mutation rate, Migration rate, Number of species, Interaction strength^2" ,flush = True )
38+ print ("Replicate, Area, Mutation rate, Migration rate, Number of species, Interaction strength^2" ,flush = True )
3739for A in [1 , 2 , 4 , 6 , 9 , 12 , 16 ]:
3840 for mut_max in [1e-5 , 1e-4 , 1e-3 ]:
3941 for migration in [1e-6 , 1e-5 ]:
@@ -73,7 +75,7 @@ def av(x):
7375 step ()
7476
7577 conn = sum ([x * x for x in ecolab .interaction .val ()])/ len (ecolab .species )** 2 if len (ecolab .species )> 0 else 0
76- print (numX * numY , av (ecolab .mutation ()), av (ecolab .migration ()), len (ecolab .species ), conn , flush = True ,sep = ',' )
78+ print (replicate , numX * numY , av (ecolab .mutation ()), av (ecolab .migration ()), len (ecolab .species ), conn , flush = True ,sep = ',' )
7779
7880
7981
0 commit comments