Index: /experiments/frams/foraminifera/data/scripts/foraminifera.expdef
===================================================================
--- /experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 431)
+++ /experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 432)
@@ -13,6 +13,6 @@
 max_energy_level - maximum energy level reached so far
 gen - generation: 0 haploid, 1 diploid
-species - species: 0 hibernating 1 not hibernating
-hibernated - 0/1 foram isn't/is hibernated
+species - species: 0 not hibernating 1 hibernating
+hibernated - 0/1 foram is/isn't hibernated
 reproduce - 0/1 foram isn't/is ready for reproduction 
 ~
@@ -81,7 +81,6 @@
 	//world
 	SignalView.mode = 1;
-	ExpParams.world_size = scale(40000);
 	World.wrldwat = 200;
-	World.wrldsiz = ExpParams.world_size;
+	World.wrldsiz = scale(40000);
 	World.wrldbnd = 1;
 	ExpParams.stress = 1;
@@ -138,4 +137,6 @@
 	ExpState.totaltestedcr = 0;
 	ExpState.nutrient = "";
+
+	ExpParams.iter = 0;
 }
 
@@ -236,5 +237,5 @@
 	ExpState.nutrient = tmpvec;
 	File.writeObject(sim_params.*);
-	ExpState.nutrient = null; //vectors are only created for saving and then discardedsetForam
+	ExpState.nutrient = null; //vectors are only created for saving and then discarded
 
 	for (var cr in Populations[0])
@@ -387,5 +388,5 @@
 	else if (cr.lifespan%dir_change == 0)
 	{
-		var dir = (Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), 0);//(0.1 * Math.rnd01, 0.1 * Math.rnd01, 0);	
+		var dir = (Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), 0);	
 		dir.normalize();
 		dir.scale(-0.08);
@@ -485,5 +486,5 @@
 function onNutrientsStep(cr)
 {
-	cr.moveAbs(cr.pos_x % ExpParams.world_size, cr.pos_y % ExpParams.world_size, -ExpParams.zone1_range+0.5);
+	cr.moveAbs(cr.pos_x % World.wrldsiz, cr.pos_y % World.wrldsiz, -ExpParams.zone1_range+0.5);
 }
 
@@ -509,5 +510,5 @@
 	{
 		for (var i = 0; i < ExpParams.nutrientPop; i++)
-		{
+		{    
 			addNutrient();
 		}
@@ -524,10 +525,10 @@
 function onStep()
 {
+
+	nutrientGrowth();
 	if (ExpParams.logging == 1)
 	{
 		createStatistics();
 	}
-
-	nutrientGrowth();
 
 	//reproduction --------------------------------------------
@@ -554,5 +555,9 @@
 		}
 	}
-
+	if (ExpParams.stopping == 1)
+	{
+		if (Simulator.stepNumber == 150000)
+			Simulator.stop();
+	}
 }
 
@@ -579,9 +584,9 @@
 	}
 
-	var log_numbers = [number[0][0], number[0][1], number[1][0], number[1][1], Populations[1].size];
-	var log_energies = [e_inc[0][0], e_inc[0][1], e_inc[1][0], e_inc[1][1], e_nut];
+	var log_numbers = [number[1][0], number[1][1], number[0][0], number[0][1], Populations[1].size];
+	var log_energies = [e_inc[1][0], e_inc[1][1], e_inc[0][0], e_inc[0][1], e_nut];
 
 	log(log_numbers, "forams_log.txt");
-        log(log_energies, "energies_log.txt");
+        log(log_energies,  "energies_log.txt");
 }
 
@@ -609,4 +614,14 @@
 type:d 0 1 0
 group:Foraminifera
+
+prop:
+id:iter
+name:Iteration number
+type:d
+
+prop:
+id:stopping
+name:Stop after the given number of simulation steps
+type:d 0 1 0
 
 prop:
@@ -785,10 +800,4 @@
 group:Energy
 type:d 1 1000 10
-
-prop:
-id:world_size
-name:World size
-type:d 10 10000 20
-group:World
 
 prop:
Index: /experiments/frams/foraminifera/data/scripts/foraminifera.inc
===================================================================
--- /experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 431)
+++ /experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 432)
@@ -5,15 +5,5 @@
 {
 	colors = ["1.0,1.0,0.0","1.0,0.5,0.0"];
-	chambers = [ ["0.0,0.0,0.0,", //longitudal
-	"0.98089325428009, 0.00591040402650833, 0.00389722990803421,",
-	"1.90962779521942, -0.256769120693207, -0.16194811463356,",
-	"2.63965249061584, -0.727959632873535, -0.609036147594452,",
-	"3.17575979232788, -1.34843015670776, -1.14828503131866,",
-	"3.55273032188416, -2.22369408607483, -1.3917418718338,",
-	"3.64916682243347, -3.11888360977173, -1.01666414737701,",
-	"3.50461649894714, -3.84039807319641, -0.377427101135254,",
-	"3.15921688079834, -4.50001525878906, 0.261153399944305,",
-	"2.51528453826904, -5.16421365737915, 0.59241509437561,"],
-	["0.0,0.0,0.0,",  //coiled
+	chambers = [ ["0.0,0.0,0.0,",  //coiled
 	"1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
 	"1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
@@ -25,5 +15,15 @@
 	"1.0958571434021, 0.316927701234818, -1.813929438591,",
 	"0.903768002986908, 1.11856341362, -2.53161096572876,",
-	"0.21014116704464, 0.295340299606323, -2.45328187942505,"] ];
+	"0.21014116704464, 0.295340299606323, -2.45328187942505,"],
+        ["0.0,0.0,0.0,", //longitudal
+	"0.98089325428009, 0.00591040402650833, 0.00389722990803421,",
+	"1.90962779521942, -0.256769120693207, -0.16194811463356,",
+	"2.63965249061584, -0.727959632873535, -0.609036147594452,",
+	"3.17575979232788, -1.34843015670776, -1.14828503131866,",
+	"3.55273032188416, -2.22369408607483, -1.3917418718338,",
+	"3.64916682243347, -3.11888360977173, -1.01666414737701,",
+	"3.50461649894714, -3.84039807319641, -0.377427101135254,",
+	"3.15921688079834, -4.50001525878906, 0.261153399944305,",
+	"2.51528453826904, -5.16421365737915, 0.59241509437561,"]];
 }
 
@@ -37,5 +37,5 @@
 	for (var i = 0; i < chamber_num; i++)
 	{
-		rad = getProperty(gen, "chamber_proculus") + getProperty(gen, "chamber_difference") * (i + 1); 
+		rad = getProperty(gen, "chamber_proculus") + getProperty(gen, "chamber_difference") * (i + 1);
 		geno += "\n" + "p:" + chambers[species][i+1] + "sh=1,sx=" + rad + ",sy=" + rad + ",sz=" + rad + ",vr=" + colors[gen];
 	}
@@ -46,5 +46,5 @@
 	}
 
-	if (species == 1) geno += "\nn:p=0,d=\"S\"";
+	if (species == 0) geno += "\nn:p=0,d=\"S\"";
 
 	return geno;
@@ -55,5 +55,5 @@
 	if (mode["opt"] == 0) //initial
 	{
-		mode["cr"].user1 = {"min_repro_energies" : [max_chamber_energ[0][getProperty(0, "min_repro_energ")], max_chamber_energ[1][getProperty(1, "min_repro_energ")]], "hibernation" : 1 - mode["species"]};
+		mode["cr"].user1 = {"min_repro_energies" : [max_chamber_energ[0][getProperty(0, "min_repro_energ")], max_chamber_energ[1][getProperty(1, "min_repro_energ")]], "hibernation" : mode["species"]};
 		mode["cr"].user2 = {"max_energy_level" : getProperty(0,"energies0"), "gen" : 0,  "hibernated" : 0, "species" : mode["species"], "reproduce" : 0};
 	}
