Index: /experiments/frams/foraminifera/data/scripts/foraminifera.expdef
===================================================================
--- /experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 420)
+++ /experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 421)
@@ -6,6 +6,6 @@
 user1:
 genes which are not encoded in Ff genotype:
-Vamin - Minimum stored energy necessary for reproduction
-amin - minimal age for reproduction
+minenergy - Minimum stored energy necessary for reproduction
+minage - minimal age for reproduction
 
 user2:
@@ -20,5 +20,5 @@
 - xxx.get(...) changed to xxx[...]
 - xxx.set(...,...) changed to xxx[...]=...
-- function placeRandomlyNotColliding(cr) explicitly called when adding a new creature, and removed collision checking from onCreaturesBorn() which is also called when "growing" (since "growing" is implemented as creating a new creature in place of the old one, so onCreaturesBorn() is also called)
+- function placeRandomlyNotColliding(cr) explicitly called when adding a new creature, and removed collision checking from onForamsBorn() which is also called when "growing" (since "growing" is implemented as creating a new creature in place of the old one, so onForamsBorn() is also called)
 - use creature's center (not the bbox corner) when growing
 - added "S" receptor to visualize the difference between diplo and haplo generations
@@ -26,5 +26,5 @@
 */
 
-global foodenergywaiting;
+global nutrientenergywaiting;
 global reprocounter;
 
@@ -35,5 +35,4 @@
 function onExpDefLoad()
 {
-
 	// define genotype and creature groups
 	GenePools.clear();
@@ -44,5 +43,5 @@
 
 	var pop = Populations[0];
-	pop.name = "Creatures";
+	pop.name = "Forams";
 	pop.en_assim = 0;
 	pop.nnsim = 0;
@@ -55,5 +54,5 @@
 	pop.perfperiod = 25;
 
-	pop = Populations.addGroup("Food");
+	pop = Populations.addGroup("Nutrients");
 	pop.nnsim = 0;
 	pop.enableperf = 0;
@@ -63,50 +62,44 @@
 	pop.othermask = 0x10000;
 
-	//TODO remove unused params
-
 	//radius of the chamber
 	ExpParams.rads = [1.2, 0.6];
-	//ExpParams.rads = [2, 2];
 	//inital genotypes
-	ExpParams.genh = "//0\np:sh=1,sx=" + ExpParams.rads[0] + ",sy=" + ExpParams.rads[0] + ",sz=" + ExpParams.rads[0] + ", rz=3.14159265358979";
-	ExpParams.gend = "//0\np:sh=1,sx=" + ExpParams.rads[1] + ",sy=" + ExpParams.rads[1] + ",sz=" + ExpParams.rads[1] + ", rz=3.14159265358979";
-	ExpParams.gend += "\nn:p=0,d=\"S\"";
+	ExpParams.genh = createForamGenotype(ExpParams.rads[0]);
+	ExpParams.gend = createForamGenotype(ExpParams.rads[1])+"\nn:p=0,d=\"S\"";
+	ExpParams.creath = -0.99; //just above the bottom
 	ExpParams.e_meta = 0.1;
 	ExpParams.feedrate = 0.5;
 	ExpParams.feede0 = 100;
 	ExpParams.feedtrans = 3;
-	ExpParams.creath = -0.99; //just above the bottom
-	ExpParams.foodgen = "//0\np:sh=2,sx=0.1,sy=0.1,sz=0.1\nn:d=T,p=0"; //TODO food size as param
+	ExpParams.nutrientsize = 0.1;
+	ExpParams.nutrientgen = "//0\np:sh=2,sx="+ExpParams.nutrientsize+",sy="+ExpParams.nutrientsize+",sz="+ExpParams.nutrientsize+"\nn:d=T,p=0"; 
 	ExpParams.autorestart = 0;
-	ExpParams.psize = 10;
+	ExpParams.popsize = 10;
 	//ExpParams.logging = 1; //uncomment to enable logging simulation parameters to log files
 
 	//number of offspring
-	ExpParams.ofnumh = 40;
-	ExpParams.ofnumd = 25;
+	ExpParams.energy0h = 40;
+	ExpParams.energy0d = 25;
 	//minial volume for reproduction
-	ExpParams.v_min_d = 300;
-	ExpParams.v_min_h = 300;
+	ExpParams.minenerg = [300, 300];
 	//minimal age for reproduction
-	ExpParams.age_min_d = 100;
-	ExpParams.age_min_h = 100;
+	ExpParams.minage = [100, 100];
 	//crossover probability
 	ExpParams.crossprob = 0.4;
 	//mutation probability
 	ExpParams.mutationprob = 0.2;
-	ExpParams.repro_time = 200;
-	ExpParams.repro_thr = 1;
-
-	//grwoth speed in time steps
-	ExpParams.growth_step = 50; //50
+	ExpParams.repro_time = 45;
+
+	//grwoth speed in simulation steps
+	ExpParams.growth_step = 50;
 
 	ExpState.totaltestedcr = 0;
-	ExpState.food = "";
-	foodenergywaiting = ExpParams.feede0;
+	ExpState.nutrient = "";
+	nutrientenergywaiting = ExpParams.feede0;
 	reprocounter = 0;
 
-	ExpParams.wsize = 50;
+	ExpParams.worldsize = 50;
 	World.wrldwat = 50;
-	World.wrldsiz = ExpParams.wsize;
+	World.wrldsiz = ExpParams.worldsize;
 	World.wrldbnd = 1;
 }
@@ -119,16 +112,16 @@
 	Populations[1].clear();
 
-	for (var i = 0; i < ExpParams.psize; i++)
+	for (var i = 0; i < ExpParams.popsize; i++)
 	{
 		var cr = Populations[0].add(ExpParams.genh);
 		cr.name = "Initial creature" + i;
 		placeCreatureRandomly(cr, 0, 0);
-		cr.energy0 = ExpParams.v_min_h - ExpParams.repro_thr;
+		cr.energy0 = ExpParams.energy0h;
 		cr.energy = cr.energy0;
-		cr.user1 = {"vamin" : ExpParams.v_min_h, "amin": ExpParams.age_min_h};
-		cr.user2 = {"Va" : ExpParams.v_min_h - ExpParams.repro_thr, "gen" : 0, "growth_step" : ExpParams.growth_step, "rsize" : ExpParams.rads[0], "vinit" : ExpParams.v_min_h - ExpParams.repro_thr};
+		cr.user1 = {"minenergy" : ExpParams.minenerg[0], "minage": ExpParams.minage[0]};
+		cr.user2 = {"Va" : ExpParams.energy0h, "gen" : 0, "growth_step" : ExpParams.growth_step, "rsize" : ExpParams.rads[0], "vinit" : ExpParams.energy0h};
 	}
 	ExpState.totaltestedcr = 0;
-	foodenergywaiting = ExpParams.feede0;
+	nutrientenergywaiting = ExpParams.feede0;
 }
 
@@ -142,5 +135,5 @@
 	Loader.run();
 
-	Simulator.print("Loaded " + Populations[0].size + " creatures and " + Populations[1].size + " food objects");
+	Simulator.print("Loaded " + Populations[0].size + " Forams and " + Populations[1].size + " nutrient objects");
 }
 
@@ -186,7 +179,7 @@
 		tmpvec.add([cr.center_x, cr.center_y, cr.energy]);
 
-	ExpState.food = tmpvec;
+	ExpState.nutrient = tmpvec;
 	File.writeObject(sim_params.*);
-	ExpState.food = null; //vectors are only created for saving and then discarded
+	ExpState.nutrient = null; //vectors are only created for saving and then discarded
 
 	for (var cr in Populations[0])
@@ -196,7 +189,12 @@
 // -------------------------------- experiment end --------------------------------
 
-// -------------------------------- creature begin --------------------------------
-
-function onCreaturesBorn(cr)
+// -------------------------------- foram begin -----------------------------------
+
+function createForamGenotype(radius)
+{
+	return "//0\np:sh=1,sx=" + radius + ",sy=" + radius + ",sz=" + radius + ", rz=3.14159265358979";
+}
+
+function onForamsBorn(cr)
 {
 	cr.idleen = ExpParams.e_meta;
@@ -222,10 +220,11 @@
 }
 
-function onCreaturesStep(cr)
+function foramMove(cr)
 {
 	//TODO moving inside sediment?
 	cr.moveAbs(cr.pos_x, cr.pos_y, 0); //adjustment in z axis
+
 	var p = cr.getMechPart(0);
-	var n = cr.signals.receiveSet("food", ExpParams.food_range);
+	var n = cr.signals.receiveSet("nutrient", ExpParams.nutrient_range);
 
 	//if signals are received find the source of the nearest
@@ -262,4 +261,28 @@
 		cr.localDrive = (0.1 * Math.rnd01, 0.1 * Math.rnd01, 0);
 	}
+}
+
+function foramGrow(cr)
+{
+		//TODO how size is related to the energy?
+		cr.user2["rsize"] = ExpParams.rads[cr.user2["gen"]] * Math.min(Math.max(float(cr.user2["Va"] / cr.user2["vinit"]) * 0.5, 1.0), 2.5);
+		var geno = createForamGenotype(cr.user2["rsize"]);
+		if (cr.user2["gen"] == 1)
+		{
+			geno += "\nn:p=0,d=\"S\""; //TODO why initial genotypes are not used as defined in ExpParams?
+			//TODO maybe it would be nice if they rotated so the "S" would show where they are going (direction/intention)
+		}
+		var cr2 = Populations[0].add(geno);
+		cr2.energy0 = cr.energy;
+		cr2.energy = cr2.energy0;
+		setGenotype(cr2, cr.user1, cr.user2);
+		cr2.moveAbs(cr.center_x - cr2.size_x / 2, cr.center_y - cr2.size_y / 2, cr.pos_z);
+
+		Populations[0].delete(cr);
+}
+
+function onForamsStep(cr)
+{
+	foramMove(cr);
 
 	//energy costs depend on size
@@ -270,9 +293,10 @@
 	}
 
+	//TODO lifespan should not be used, it is set to 0 with every growth_step
 	if (cr.lifespan >= ExpParams.max_age)
 	{
-		//TODO what is max age value? should there be one?
-		Populations[0].kill(cr);
-		return;
+		//TODO what is max age value? should there be one
+		//Populations[0].kill(cr);
+		//return;
 	}
 
@@ -280,18 +304,5 @@
 	if (cr.lifespan == cr.user2["growth_step"])
 	{
-		//TODO how size is related to the energy?
-		cr.user2["rsize"] = ExpParams.rads[cr.user2["gen"]] * Math.min(Math.max(float(cr.user2["Va"] / cr.user2["vinit"]) * 0.5, 1.0), 2.5);
-		var geno = "//0\np:sh=1,sx=" + cr.user2["rsize"] + ",sy=" + cr.user2["rsize"] + ",sz=" + cr.user2["rsize"] + ", rz=3.14159265358979";
-		if (cr.user2["gen"] == 1)
-		{
-			geno += "\nn:p=0,d=\"S\""; //TODO why initial genotypes are not used as defined in ExpParams?
-			//TODO maybe it would be nice if they rotated so the "S" would show where they are going (direction/intention)
-		}
-		var cr2 = Populations[0].add(geno);
-		cr2.energy = cr.energy;
-		setGenotype(cr2, cr.user1, cr.user2);
-		cr2.moveAbs(cr.center_x - cr2.size_x / 2, cr.center_y - cr2.size_y / 2, cr.pos_z);
-
-		Populations[0].delete(cr);
+		foramGrow(cr);
 	}
 	else
@@ -301,9 +312,9 @@
 		if (cr.user2["gen"] == 0)
 		{
-			properSize = cr.user2["Va"] >= cr.user1["vamin"];
+			properSize = cr.user2["Va"] >= cr.user1["minenergy"];
 		}
 		else
 		{
-			properSize = cr.user2["Va"] >= cr.user1[0]["vamin"]; //TODO gene selection
+			properSize = cr.user2["Va"] >= cr.user1[0]["minenergy"]; //TODO gene selection
 		}
 
@@ -324,5 +335,5 @@
 }
 
-function onCreaturesDied(cr)
+function onForamsDied(cr)
 {
 	//fossilization
@@ -339,31 +350,31 @@
 	if (cr.user2["gen"] == 0)
 	{
-		cr.user1 = {"vamin" : new_user1["vamin"], "amin": new_user1["amin"] };
+		cr.user1 = {"minenergy" : new_user1["minenergy"], "minage": new_user1["minage"] };
 	}
 	else if (cr.user2["gen"] == 1)
 	{
-		cr.user1 = [ {"vamin" : new_user1[0]["vamin"], "amin": new_user1[0]["amin"] }, {"vamin" : new_user1[1]["vamin"], "amin": new_user1[1]["amin"] }];
-	}
-
-}
-
-// -------------------------------- creature end --------------------------------
-
-// -------------------------------- food begin --------------------------------
-
-function onFoodStep(cr)
-{
-	cr.moveAbs(cr.pos_x % ExpParams.wsize, cr.pos_y % ExpParams.wsize, 0.5);
-}
-
-function addfood()
-{
-	var cr = Populations[1].add(ExpParams.foodgen);
-
-	cr.name = "Food";
+		cr.user1 = [ {"minenergy" : new_user1[0]["minenergy"], "minage": new_user1[0]["minage"] }, {"minenergy" : new_user1[1]["minenergy"], "minage": new_user1[1]["minage"] }];
+	}
+
+}
+
+// --------------------------------foram end -------------------------------------
+
+// -------------------------------- nutrient begin --------------------------------
+
+function onNutrientsStep(cr)
+{
+	cr.moveAbs(cr.pos_x % ExpParams.worldsize, cr.pos_y % ExpParams.worldsize, 0.5);
+}
+
+function addNutrient()
+{
+	var cr = Populations[1].add(ExpParams.nutrientgen);
+
+	cr.name = "Nutrients";
 	cr.idleen = 0;
 	cr.energy0 = ExpParams.feede0;
 	cr.energy = cr.energy0;
-	cr.signals.add("food");
+	cr.signals.add("nutrient");
 
 	cr.signals[0].value = cr.getMechPart(0);
@@ -372,5 +383,5 @@
 }
 
-function onFoodCollision()
+function onNutrientsCollision()
 {
 	if (Collision.Creature2.user2 != null)
@@ -384,5 +395,5 @@
 }
 
-// -------------------------------- food end --------------------------------
+// -------------------------------- nutrient end --------------------------------
 
 
@@ -410,7 +421,8 @@
 name:Maximal age
 type:d 100 1000 500
-
-prop:
-id:wsize
+group:Foraminifera
+
+prop:
+id:worldsize
 name:World size
 type:d 10 1000 20
@@ -420,4 +432,6 @@
 name:Growth step
 type:d -1 10000 1000
+group:Foraminifera
+help:You can turn off growth by setting this param to -1
 
 prop:
@@ -425,37 +439,21 @@
 name:Haploid and diploid radius
 type:x
-
-prop:
-id:age_min_h
-name:Min reproduction age of haploid forams
-type:d 100 10000 300
-group:Foraminifera
-
-prop:
-id:age_min_d
-name:Min reproduction age of diploid forams
-type:d 100 10000 200
-group:Foraminifera
-
-prop:
-id:v_min_h
-name:Min reproduction energy of haploid forams
-type:f 10 10000 300
-group:Foraminifera
-
-prop:
-id:v_min_d
-name:Min reproduction energy of diploid forams
-type:f 10 10000 150
-group:Foraminifera
-
-prop:
-id:repro_thr
-name:Energy creatures need to gather to reproduce
-type:d 1 1000 1
-
-prop:
-id:food_range
-name:Range of food smell
+group:Foraminifera
+
+prop:
+id:minage
+name:Min reproduction age of forams
+type:x
+group:Foraminifera
+
+prop:
+id:minenerg
+name:Min reproduction energy of forams
+type:x
+group:Foraminifera
+
+prop:
+id:nutrient_range
+name:Range of nutrient smell
 type:d 0 10000 10000
 
@@ -466,15 +464,11 @@
 
 prop:
-id:psize
-name:Initial population size
+id:popsize
+name:Initial forams population size
 type:d 1 1000 100
-
-prop:
-id:logging
-name:Log statistics to file
-type:d 0 1 0
-
-prop:
-id:ofnumh
+group:Foraminifera
+
+prop:
+id:energy0h
 name:Number of offspring from haploid forams
 type:d
@@ -482,5 +476,5 @@
 
 prop:
-id:ofnumd
+id:energy0d
 name:Number of offspring from diploid forams
 type:d
@@ -491,4 +485,5 @@
 name:Probability of reproduction
 type:f 0 1 0.9
+group:Foraminifera
 
 prop:
@@ -496,4 +491,5 @@
 name:Crossover probability
 type:f 0 1 0
+group:Foraminifera
 
 prop:
@@ -501,4 +497,5 @@
 name:Mutation probability
 type:f 0 1 0
+group:Foraminifera
 
 prop:
@@ -519,5 +516,5 @@
 type:f -1 50
 help:~
-Vertical position (above the surface) where new creatures are revived.
+Vertical position (above the surface) where new Forams are revived.
 Negative values are only used in the water area:
   0   = at the surface
@@ -541,5 +538,5 @@
 prop:
 id:feede0
-name:Food's energy
+name:Nutrients's energy
 group:Energy
 type:f 0 1000
@@ -552,8 +549,27 @@
 
 prop:
-id:foodgen
-name:Food's genotype
+id:nutrientgen
+name:Nutrients's genotype
 group:Energy
 type:s 1
+
+prop:
+id:nutrientsize
+name:Nutrients's size
+group:Energy
+type:f 0.1
+
+prop:
+id:nutrientPop
+name:Nutrients population size
+group:Energy
+type:d 1 1000 10
+
+state:
+id:nutrient
+name:Nutrients locations
+help:vector of vectors [x,y,energy]
+type:x
+flags:32
 
 prop:
@@ -573,18 +589,11 @@
 state:
 id:totaltestedcr
-name:Evaluated creatures
-help:Total number of the creatures evaluated in the experiment
+name:Evaluated Forams
+help:Total number of the Forams evaluated in the experiment
 type:d
 flags:16
 
 prop:
-id:foodPop
-name:Food size
-type:d 1 1000 10
-
-state:
-id:food
-name:Food locations
-help:vector of vectors [x,y,energy]
-type:x
-flags:32
+id:logging
+name:Log statistics to file
+type:d 0 1 0
Index: /experiments/frams/foraminifera/data/scripts/foraminifera.inc
===================================================================
--- /experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 420)
+++ /experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 421)
@@ -6,9 +6,9 @@
 function reproduce_haploid(parent, parent2)
 {
-	var number = parent.user2["Va"] / ExpParams.ofnumd + parent2.user2["Va"] / ExpParams.ofnumd;
+	var number = parent.user2["Va"] / ExpParams.energy0d + parent2.user2["Va"] / ExpParams.energy0d;
 
 	for (var j = 0; j < number; j++)
 	{
-		createOffspring(ExpParams.gend, ExpParams.ofnumd, [parent.user1, parent2.user1], {"Va" : ExpParams.ofnumd, "gen" : 1 , "growth_step" : ExpParams.growth_step, "rsize": ExpParams.rads[1], "vinit": ExpParams.ofnumd}); //TODO genes from both generations in user1
+		createOffspring(ExpParams.gend, ExpParams.energy0d, [parent.user1, parent2.user1], {"Va" : ExpParams.energy0d, "gen" : 1 , "growth_step" : ExpParams.growth_step, "rsize": ExpParams.rads[1], "vinit": ExpParams.energy0d}); //TODO genes from both generations in user1
 	}
 }
@@ -16,5 +16,5 @@
 function reproduce_diploid(parent)
 {
-	var number = parent.user2["Va"] / ExpParams.ofnumh;
+	var number = parent.user2["Va"] / ExpParams.energy0h;
 	for (var j = 0; j < number / 2; j++)
 	{
@@ -23,5 +23,5 @@
 		if (Math.rnd01 < ExpParams.crossprob)
 		{
-			crossover(parent, "vamin");
+			crossover(parent, "minenergy");
 			crossed = 1;
 		}
@@ -29,5 +29,5 @@
 		for (var k = 0; k < 2; k++)
 		{
-			createOffspring(ExpParams.genh, ExpParams.ofnumh, {"vamin" : ExpParams.v_min_h, "amin": ExpParams.age_min_h}, {"Va" : ExpParams.ofnumh, "gen" : 0 , "growth_step" : ExpParams.growth_step, "rsize" : ExpParams.rads[0], "vinit": ExpParams.ofnumh});
+			createOffspring(ExpParams.genh, ExpParams.energy0h, {"minenergy" : ExpParams.minenerg[0], "minage": ExpParams.minage[0]}, {"Va" : ExpParams.energy0h, "gen" : 0 , "growth_step" : ExpParams.growth_step, "rsize" : ExpParams.rads[0], "vinit": ExpParams.energy0h}); //TODO different vamin and amin for haploids and diploids?
 		}
 
@@ -35,5 +35,5 @@
 		if (crossed == 1)
 		{
-			crossover(parent, "vamin");
+			crossover(parent, "minenergy");
 			crossed = 0;
 		}
@@ -61,69 +61,20 @@
 function onStep()
 {
-	var haploids = 0;
-	var diploids = 0;
-	var e_inc_h = 0.0;
-	var e_inc_d = 0.0;
-	var e_nut = 0.0;
-	var size_h = 0.0;
-	var size_d = 0.0;
-	var vmin_h = 0.0;
-	var vmin_d = 0.0;
-
-	for (var i = 0; i < Populations[0].size; i++)
-	{
-		var cr = Populations[0].get(i);
-		if (cr.user2["gen"] == 0)
-		{
-			haploids += 1;
-			e_inc_h += cr.energy;
-			size_h += ExpParams.rads[0]; //TODO change of size dependent on gene
-			vmin_h += cr.user1["vamin"];
-		}
-		else if (cr.user2["gen"] == 1)
-		{
-			diploids += 1;
-			e_inc_d += cr.energy;
-			size_d += ExpParams.rads[1]; //TODO change of size dependent on gene
-			vmin_d += cr.user1[0]["vamin"];
-		}
-	}
-
-	for (var i = 0; i < Populations[1].size; i++)
-	{
-		var cr = Populations[1].get(i);
-		e_nut += cr.energy;
-	}
-
-	if (haploids < 2 && diploids == 0)
-	{
-		Simulator.print("no more creatures, stopped.");
-		Simulator.stop();
-	}
-
-	var l1 = [haploids, diploids, Populations[1].size];
-	var l2 = [e_inc_h, e_inc_d, e_nut];
-	var dp = diploids;
-	var hp = haploids;
-	if (dp == 0) dp = 0.000001;
-	if (hp == 0) hp = 0.000001;
-	var l3 = [size_h / hp, vmin_h / hp, size_d / dp, vmin_d / dp];
 
 	if (ExpParams.logging == 1)
 	{
-		log(l1, "log.txt");
-		log(l2, "log2.txt");
-		log(l3, "log3.txt");
+		createStatistics();
 	}
-	//food growth ---------------------------------------------
-	foodenergywaiting = foodenergywaiting + ExpParams.feedrate;
-	if (foodenergywaiting > ExpParams.feede0)
+
+	//nutrient growth ---------------------------------------------
+	nutrientenergywaiting = nutrientenergywaiting + ExpParams.feedrate;
+	if (nutrientenergywaiting > ExpParams.feede0)
 	{
-		for (var i = 0; i < ExpParams.foodPop; i++)
+		for (var i = 0; i < ExpParams.nutrientPop; i++)
 		{
-			addfood();
+			addNutrient();
 		}
 
-		foodenergywaiting = 0.0;
+		nutrientenergywaiting = 0.0;
 		Simulator.checkpoint();
 	}
@@ -183,3 +134,52 @@
 }
 
+function createStatistics()
+{
+	var haploids = 0;
+	var diploids = 0;
+	var e_inc_h = 0.0;
+	var e_inc_d = 0.0;
+	var e_nut = 0.0;
+	var size_h = 0.0;
+	var size_d = 0.0;
+	var vmin_h = 0.0;
+	var vmin_d = 0.0;
+
+	for (var i = 0; i < Populations[0].size; i++)
+	{
+		var cr = Populations[0].get(i);
+		if (cr.user2["gen"] == 0)
+		{
+			haploids += 1;
+			e_inc_h += cr.energy;
+			size_h += ExpParams.rads[0]; //TODO change of size dependent on gene
+			vmin_h += cr.user1["minenergy"];
+		}
+		else if (cr.user2["gen"] == 1)
+		{
+			diploids += 1;
+			e_inc_d += cr.energy;
+			size_d += ExpParams.rads[1]; //TODO change of size dependent on gene
+			vmin_d += cr.user1[0]["minenergy"];
+		}
+	}
+
+	for (var i = 0; i < Populations[1].size; i++)
+	{
+		var cr = Populations[1].get(i);
+		e_nut += cr.energy;
+	}
+
+	var l1 = [haploids, diploids, Populations[1].size];
+	var l2 = [e_inc_h, e_inc_d, e_nut];
+	var dp = diploids;
+	var hp = haploids;
+	if (dp == 0) dp = 0.000001;
+	if (hp == 0) hp = 0.000001;
+	var l3 = [size_h / hp, vmin_h / hp, size_d / dp, vmin_d / dp];
+
+	log(l1, "log_sizes.txt");
+	log(l2, "log_energy.txt");
+	log(l3, "log_sizes_v.txt");
+}
 // -------------------------------- step end --------------------------------
