Index: experiments/frams/foraminifera/data/scripts/foraminifera.expdef
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 429)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 430)
@@ -13,5 +13,5 @@
 max_energy_level - maximum energy level reached so far
 gen - generation: 0 haploid, 1 diploid
-species - species: 0 not hibernating 1 hibernating
+species - species: 0 hibernating 1 not hibernating
 hibernated - 0/1 foram isn't/is hibernated
 reproduce - 0/1 foram isn't/is ready for reproduction 
@@ -35,5 +35,5 @@
 global o;
 global max_chamber_energ;
-
+global dir_change;
 
 @include "foraminifera.inc"
@@ -69,8 +69,18 @@
 	//pop.othermask = 0x10002;
 
+	//ExpParams.showRet = 1; //uncomment to show reticulopodia
+
+	pop = Populations.addGroup("Reticulopodia");
+	pop.nnsim = 0;
+	pop.enableperf = 0;
+	pop.death = 0;
+	pop.energy = 0;
+	pop.selfmask = 0x20002;
+	pop.othermask = 0x10000;
+	
 	//world
 	SignalView.mode = 1;
-	ExpParams.world_size = 100;
-	World.wrldwat = ExpParams.world_size;
+	ExpParams.world_size = scale(40000);
+	World.wrldwat = 200;
 	World.wrldsiz = ExpParams.world_size;
 	World.wrldbnd = 1;
@@ -82,5 +92,5 @@
 
 	//reproduction
-	ExpParams.foramPop = 3;
+	ExpParams.foramPop = 10;	
 	ExpParams.crossprob = 0.4;
 	ExpParams.mutationprob = 0.2;
@@ -89,6 +99,9 @@
 
 	//morphology
+	dir_change = 500;
+	ExpParams.zone1_range = scale(5000);
+	ExpParams.zone2_range = scale(8000);
 	init_chambers();
-	ExpParams.chamber_proculus_haplo = scale(60);
+	ExpParams.chamber_proculus_haplo = scale(50);
 	ExpParams.chamber_difference_haplo = 0.0;
 	ExpParams.chamber_proculus_diplo = scale(20);
@@ -100,20 +113,19 @@
 		{
 			max_chamber_energ[j].add(((Math.pow(getProperty(j, "chamber_proculus"),3) + Math.pow(getProperty(j, "chamber_proculus") + (i) * getProperty(j, "chamber_difference"),3))*(i+1))/2);
-
 		}                                  
 	}
-	ExpParams.zone1_range = scale(250);
-	ExpParams.zone2_range = scale(5000);
 
 	//energetics
-	ExpParams.min_repro_energ_haplo = max_chamber_energ[0][2];
-	ExpParams.min_repro_energ_diplo = max_chamber_energ[1][8];
-	ExpParams.e_meta = 0.00003 * max_chamber_energ[0][0];
-	ExpParams.energy_hib = 0.00003 * max_chamber_energ[0][0];
-	ExpParams.energy_move = 0.0003 * max_chamber_energ[0][0];
-	ExpParams.energies0_haplo = max_chamber_energ[0][0] - 0.1*max_chamber_energ[0][0];
-	ExpParams.energies0_diplo = max_chamber_energ[1][0] - 0.1*max_chamber_energ[1][0];
-	ExpParams.feedtrans = 0.05;
-	ExpParams.e_repro_cost_haplo = 0.5; 
+	ExpParams.min_repro_energ_haplo = 4;
+	ExpParams.min_repro_energ_diplo = 6;
+
+	ExpParams.e_meta = 0.0002; 
+	ExpParams.energy_hib = 0.0001;
+	ExpParams.energy_move = 0.00025;
+
+	ExpParams.energies0_haplo = max_chamber_energ[0][0] - 0.001*max_chamber_energ[0][0];
+	ExpParams.energies0_diplo = max_chamber_energ[1][0] - 0.001*max_chamber_energ[1][0];
+	ExpParams.feedtrans = 0.5;
+	ExpParams.e_repro_cost_haplo = 0.7; 
 	ExpParams.e_repro_cost_diplo = 0.3;
 
@@ -121,6 +133,6 @@
 	ExpParams.nutrientsize = scale(10);
 	ExpParams.energy_nut = 100 * Math.pow(ExpParams.nutrientsize, 3);
-	ExpParams.nutrientPop = 10;
-	ExpParams.feedrate = 0.0025;
+	ExpParams.nutrientPop = 1;
+	ExpParams.feedrate = 0.1;
 	nutrientenergywaiting = ExpParams.energy_nut;
 	ExpState.totaltestedcr = 0;
@@ -157,4 +169,5 @@
 	Populations[0].clear();
 	Populations[1].clear();
+	Populations[2].clear();
 
 	for (var i = 0; i < ExpParams.foramPop; i++)
@@ -223,5 +236,5 @@
 	ExpState.nutrient = tmpvec;
 	File.writeObject(sim_params.*);
-	ExpState.nutrient = null; //vectors are only created for saving and then discarded
+	ExpState.nutrient = null; //vectors are only created for saving and then discardedsetForam
 
 	for (var cr in Populations[0])
@@ -233,7 +246,22 @@
 // -------------------------------- foram begin -----------------------------------
 
+function setForamMeta(cr, gen)
+{
+	cr.idleen = ExpParams.e_meta * max_chamber_energ[gen][Math.min(lastChamberNum(cr), max_chamber_energ[gen].size-1)];
+}
+
+function lastChamberNum(cr)
+{
+	return cr.numparts-1;
+}
+
 function onForamsBorn(cr)
 {
-	cr.idleen = ExpParams.e_meta;
+	setForamMeta(cr, 1);
+	if (ExpParams.showRet == 1)
+	{
+		var ret = Populations[2].add("//0\np:sh=3,sx=0.01,sy="+ExpParams.zone1_range+",sz="+ExpParams.zone1_range+",ry=1.57");
+		cr.user3 = ret;
+	}
 }
 
@@ -253,5 +281,5 @@
 function foramGrow(cr, chamber_num)
 {
-	var geno = createForamGenotype(cr.user2["gen"], cr.user2["species"], chamber_num);
+	var geno = createForamGenotype(cr.user2["gen"], cr.user2["species"], chamber_num+1);
 	var cr2 = Populations[0].add(geno);
 
@@ -261,5 +289,10 @@
 	setGenotype({"cr" : cr2, "parent_user1" : cr.user1, "parent_user2" : cr.user2, "opt" : 2});
 	cr2.moveAbs(cr.center_x - cr2.size_x / 2, cr.center_y - cr2.size_y / 2, cr.pos_z);
-
+	setForamMeta(cr2, cr2.user2["gen"]);
+
+	if (ExpParams.showRet == 1)
+	{
+		Populations[2].delete(cr.user3);
+	}
 	Populations[0].delete(cr);
 }
@@ -279,12 +312,21 @@
 		var mindist = 100000000000;
 		var mindistvec = null;
+		var eating = 0;
 
 		for (i = 0; i < n.size; i++)
 		{
-			mp = n[i].value;
+			mp = n[i].value.getMechPart(0);
 			distvec.set(mp.pos);
 			distvec.sub(p.pos);
 			dist = distvec.length;
-			if (dist < mindist)
+			if (dist < ExpParams.zone1_range)
+			{
+				if (n[i].value != null)
+				{
+					energyTransfer(cr, n[i].value);
+					eating = 1;
+				}
+			}
+			else if (eating == 0 && cr.user2["hibernated"] == 0 && dist < mindist)
 			{
 				mindist = dist;
@@ -293,7 +335,12 @@
 		}
 
-		mindistvec.normalize();
-		mindistvec.scale(-0.08);
-		cr.localDrive = mindistvec;
+		if (!eating && cr.user2["hibernated"] == 0)
+		{
+			mindistvec.normalize();
+			mindistvec.scale(-0.08);
+			cr.localDrive = mindistvec;
+			moveEnergyDec(cr);
+		}
+
 		return 1;
 	}
@@ -305,11 +352,7 @@
 function moveEnergyDec(cr)
 {
-	if (cr.user2["hibernated"] == 1)
-	{
-		cr.energy_m += ExpParams.energy_hib;
-	}
-	else
-	{
-		cr.energy_m += ExpParams.energy_move;
+	if (cr.user2["hibernated"] == 0)
+	{
+		cr.energy_m += ExpParams.energy_move * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)];
 	}
 }
@@ -320,27 +363,11 @@
 
 	//adjustment in z axis
-	cr.moveAbs(cr.pos_x, cr.pos_y, 0.5);
-
-	//are there any nutrients in zone 1?
-	if (cr.boundingBoxCollisions() == 2)
-	{
-		if (cr.user2["hibernated"] == 1)
-			cr.user2["hibernated"] = 0;
-		return;	
-	}
-
-	else if (cr.user2["hibernated"] == 1)
-	{ 
-		moveEnergyDec(cr);
-		return;
-	}
-
-	//are there any nutrients in zone 2?
-	else
+	cr.moveAbs(cr.pos_x, cr.pos_y, 0);
+
+	//are there any nutrients in zone 1 or 2?
 	{
 		var moved = stepToNearest(ExpParams.zone2_range); //TODO weighted sum of distance and energy
 		if (moved==1)
-		{
-			moveEnergyDec(cr); 
+		{ 
 			return;
 		}
@@ -348,5 +375,4 @@
 
 	//no nutrients in zone 2
-
 	var hibernation = 0;
 	if (cr.user2["gen"] == 0) hibernation =  cr.user1["hibernation"];
@@ -355,27 +381,43 @@
 	if (hibernation == 1)
 	{
+		reverseHib(cr);
+		cr.localDrive = XYZ.new(0,0,0);
+	}
+	//random move
+	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);	
+		dir.normalize();
+		dir.scale(-0.08);
+		cr.localDrive = dir;
 		moveEnergyDec(cr);
-		cr.user2["hibernated"] = 1;
-		cr.localDrive = XYZ.new(0,0,0);
-	}
-	//random move
+	}
+}
+
+function energyTransfer(cr1, cr2)
+{
+	cr1.localDrive = XYZ.new(0,0,0);
+	var e = cr2.getPart(0).ing * ExpParams.feedtrans; //TODO efficiency dependent on age
+	e = Math.min(cr2.energy, e) + 0.0000001;
+	//Simulator.print("transferring "+e+" to "+cr1.name+" from "+cr2.name+" ("+cr2.energy+")");
+	cr2.energy_m = cr2.energy_m + e;
+	cr1.energy_p = cr1.energy_p + e;
+	if (cr1.user2["hibernated"] == 1)
+	{
+		reverseHib(cr1);
+	}
+}
+
+function reverseHib(cr)
+{
+	if (cr.user2["hibernated"] == 1)
+	{
+		setForamMeta(cr, cr.user2["gen"]); //unhibernate
+	} 
 	else
 	{
-		cr.localDrive = (0.1 * Math.rnd01, 0.1 * Math.rnd01, 0);
-		moveEnergyDec(cr);
-	}
-}
-
-function onForamsCollision()
-{
-	if (Collision.Creature1.user2 != null)
-	{
-		Collision.Creature1.localDrive = XYZ.new(0,0,0);
-		var e = Collision.Part2.ing * ExpParams.feedtrans; //TODO efficiency dependent on age
-		//Simulator.print("transferring "+e+" to "+Collision.Creature1.name+" from "+Collision.Creature2.name+" ("+Collision.Creature2.energy+")");
-		Collision.Creature2.energy_m = Collision.Creature2.energy_m + e;
-		Collision.Creature1.energy_p = Collision.Creature1.energy_p + e;
-		Collision.Creature1.user2["hibernated"] = 0;
-	}
+		cr.idleen = ExpParams.energy_hib * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)]; //hibernate
+	}
+	cr.user2["hibernated"] = 1 - cr.user2["hibernated"];
 }
 
@@ -383,4 +425,6 @@
 {
 	cr.getMechPart(0).orient.set(o);
+	if (ExpParams.showRet == 1)
+		cr.user3.moveAbs(cr.center_x-ExpParams.zone1_range, cr.center_y-ExpParams.zone1_range, cr.center_z-ExpParams.zone1_range-getProperty(cr.user2["gen"], "chamber_proculus"));
 
 	if (deathConditions(cr) == 1)
@@ -392,15 +436,18 @@
 	foramMove(cr);
 
+	var repro = foramReproduce(cr);
+	if (repro == 1)
+	{
+		return;
+	}
+
 	cr.user2["max_energy_level"] = Math.max(cr.energy, cr.user2["max_energy_level"]);
-	if  (cr.numparts <= chambers[0].size)
-	{
-		if ((cr.user2["max_energy_level"] >= max_chamber_energ[cr.user2["gen"]][cr.numparts-1])) 	
+	if  (lastChamberNum(cr) <= chambers[0].size-1)
+	{
+		if ((cr.user2["max_energy_level"] >= max_chamber_energ[cr.user2["gen"]][lastChamberNum(cr)])) 	
 		{
-			foramGrow(cr, cr.numparts); 
-			return;
+			foramGrow(cr, lastChamberNum(cr)); 
 		}	
-	}
-
-	foramReproduce(cr);	
+	}	
 }
 
@@ -415,4 +462,8 @@
 function onForamsDied(cr)
 {
+	if (ExpParams.showRet == 1)
+	{
+		Populations[2].delete(cr.user3);
+	}
 	//fossilization
 	var geno = GenePools[0].add(cr.genotype);
@@ -429,5 +480,5 @@
 function createNutrientGenotype(nutrientsize, zone1_range)
 {
-	return "//0\np:sh=3,sx="+nutrientsize+",sy="+(zone1_range + nutrientsize)+",sz="+(zone1_range+nutrientsize)+",ry=1.5,vr=0.0,1.0,0.0"; 
+	return "//0\np:sh=3,sx="+(nutrientsize+25)+",sy="+nutrientsize+",sz="+nutrientsize+",ry=1.5,vr=0.0,1.0,0.0"; 
 }
 
@@ -447,5 +498,5 @@
 	cr.signals.add("nutrient");
 
-	cr.signals[0].value = cr.getMechPart(0);
+	cr.signals[0].value = cr;
 
 	placeCreatureRandomly(cr, 0, 0);
@@ -503,11 +554,12 @@
 		}
 	}
+	if (Simulator.stepNumber == 150000)
+		Simulator.stop();
 }
 
 function createStatistics()
 {	
-	var number_ploidy = [0, 0];
-	var number_species = [0, 0];
-	var e_inc = [0.0, 0.0];
+	var number = [[0, 0],[0,0]]; // [species][gen]
+	var e_inc = [[0, 0],[0,0]];
 	var e_nut = 0.0;
 
@@ -516,8 +568,8 @@
 		var cr = Populations[0].get(i);
 		var gen = cr.user2["gen"];
-		number_ploidy[gen] = number_ploidy[gen] + 1;
 		var species = cr.user2["species"];
-		number_species[species] = number_species[species] + 1; 
-		e_inc[gen] = e_inc[gen] + cr.energy;
+
+		number[species][gen] = number[species][gen] + 1; 
+		e_inc[species][gen] = e_inc[species][gen] + cr.energy;
 	}
 
@@ -528,16 +580,14 @@
 	}
 
-	var log_numbers = [number_ploidy[0], number_ploidy[1], Populations[1].size];
-	var log_species = [number_species[0], number_species[1]];
-	var log_energy = [e_inc[0], e_inc[1], e_nut];
-
-	log(log_numbers, "log_sizes.txt");
-	log(log_species, "log_species.txt");
-	log(log_energy, "log_energy.txt");
+	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];
+
+	log(log_numbers, "forams_log.txt");
+        log(log_energies, "energies_log.txt");
 }
 
 function log(tolog, fname)
 {
-	var f = File.appendDirect(fname, "forams data");
+	var f = File.appendDirect(fname, "forams data"); 
 	f.writeString("" + Simulator.stepNumber);
 	for (var  i = 0; i < tolog.size; i++)
@@ -554,4 +604,10 @@
 
 ~
+
+prop:
+id:showRet
+name:Show reticulopodia
+type:d 0 1 0
+group:Foraminifera
 
 prop:
@@ -734,5 +790,5 @@
 id:world_size
 name:World size
-type:d 10 1000 20
+type:d 10 10000 20
 group:World
 
Index: experiments/frams/foraminifera/data/scripts/foraminifera.inc
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 429)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 430)
@@ -5,25 +5,25 @@
 {
 	colors = ["1.0,1.0,0.0","1.0,0.5,0.0"];
-	chambers = [ ["//0\np:sh=1,",
-	"p:0.98089325428009, 0.00591040402650833, 0.00389722990803421,",
-	"p:1.90962779521942, -0.256769120693207, -0.16194811463356,",
-	"p:2.63965249061584, -0.727959632873535, -0.609036147594452,",
-	"p:3.17575979232788, -1.34843015670776, -1.14828503131866,",
-	"p:3.55273032188416, -2.22369408607483, -1.3917418718338,",
-	"p:3.64916682243347, -3.11888360977173, -1.01666414737701,",
-	"p:3.50461649894714, -3.84039807319641, -0.377427101135254,",
-	"p:3.15921688079834, -4.50001525878906, 0.261153399944305,",
-	"p:2.51528453826904, -5.16421365737915, 0.59241509437561,"],
-	["//0\np:sh=1,",
-	"p:1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
-	"p:1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
-	"p:0.615013539791107, 0.778662621974945, 0.535521030426025,",
-	"p:0.488581955432892, 0.826426684856415, -0.381044268608093,",
-	"p:0.732419908046722, -0.0084995785728097, -1.02214300632477,",
-	"p:1.35288727283478, 0.875738024711609, -1.03719782829285,",
-	"p:0.342692613601685, 0.938660383224487, -1.45657968521118,",
-	"p:1.0958571434021, 0.316927701234818, -1.813929438591,",
-	"p:0.903768002986908, 1.11856341362, -2.53161096572876,",
-	"p:0.21014116704464, 0.295340299606323, -2.45328187942505,"] ];
+	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
+	"1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
+	"1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
+	"0.615013539791107, 0.778662621974945, 0.535521030426025,",
+	"0.488581955432892, 0.826426684856415, -0.381044268608093,",
+	"0.732419908046722, -0.0084995785728097, -1.02214300632477,",
+	"1.35288727283478, 0.875738024711609, -1.03719782829285,",
+	"0.342692613601685, 0.938660383224487, -1.45657968521118,",
+	"1.0958571434021, 0.316927701234818, -1.813929438591,",
+	"0.903768002986908, 1.11856341362, -2.53161096572876,",
+	"0.21014116704464, 0.295340299606323, -2.45328187942505,"] ];
 }
 
@@ -31,5 +31,5 @@
 {
 	var rad = getProperty(gen, "chamber_proculus"); 
-	var geno = chambers[species][0] + "sx=" + rad + ",sy=" + rad + ",sz=" + rad + ", rz=3.14159265358979,vr=" + colors[gen];
+	var geno = "//0\np:" + chambers[species][0] + "sh=1,sx=" + rad + ",sy=" + rad + ",sz=" + rad + ", rz=3.14159265358979,vr=" + colors[gen];
 
 	chamber_num = Math.min(chamber_num, chambers[species].size - 1);
@@ -38,5 +38,5 @@
 	{
 		rad = getProperty(gen, "chamber_proculus") + getProperty(gen, "chamber_difference") * (i + 1); 
-		geno += "\n" +  chambers[species][i+1] + "sh=1,sx=" + rad + ",sy=" + rad + ",sz=" + rad + ",vr=" + colors[gen];
+		geno += "\n" + "p:" + chambers[species][i+1] + "sh=1,sx=" + rad + ",sy=" + rad + ",sz=" + rad + ",vr=" + colors[gen];
 	}
 
@@ -45,4 +45,5 @@
 		geno += "\n" +  "j:"+ i +", "+ (i+1) +", sh=1";
 	}
+
 	if (species == 1) geno += "\nn:p=0,d=\"S\"";
 
@@ -54,5 +55,5 @@
 	if (mode["opt"] == 0) //initial
 	{
-		mode["cr"].user1 = {"min_repro_energies" : [getProperty(0, "min_repro_energ"), 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" : 1 - mode["species"]};
 		mode["cr"].user2 = {"max_energy_level" : getProperty(0,"energies0"), "gen" : 0,  "hibernated" : 0, "species" : mode["species"], "reproduce" : 0};
 	}
@@ -75,5 +76,5 @@
 	{
 		energy0 = getProperty(0,"energies0");
-		number = getProperty(1, "e_repro_cost") * parent.energy / energy0;
+		number = (( 1 - getProperty(1, "e_repro_cost")) * parent.energy) / energy0;
 		new_user1 = parent.user1;
 		parent.user2["gen"] = 1 - parent.user2["gen"]; //because of reversal of "gen" in createOffspring function
@@ -83,10 +84,10 @@
 	{
 		energy0 = getProperty(1,"energies0"); 
-		number = getProperty(parent.user2["gen"], "e_repro_cost") * parent.energy / energy0 + getProperty(parent.user2["gen"], "e_repro_cost") * parent2.energy / energy0;
+		number = (((1 - getProperty(parent.user2["gen"], "e_repro_cost")) * parent.energy) + ((1 -(getProperty(parent.user2["gen"], "e_repro_cost"))) * parent2.energy)) / energy0;
 		new_user1 = [parent.user1, parent2.user1];
 		gen = 1 - parent.user2["gen"];
 	}
 
-	Simulator.print("number of offspring: " + number);
+	Simulator.print("haploid number of offspring: " + number + " energ0: " + energy0);
 
 	for (var j = 0; j < number; j++)
@@ -99,7 +100,7 @@
 {
 	var energy0 = getProperty(0,"energies0");
-	var number = getProperty(parent.user2["gen"], "e_repro_cost") * parent.energy / energy0;
-
-	Simulator.print("number of offspring: " + number);
+	var number = ((1 - (getProperty(parent.user2["gen"], "e_repro_cost"))) * parent.energy) / energy0;
+
+	Simulator.print("diploid number of offspring: " + number+ " energ0: " + energy0);
 
 	for (var j = 0; j < number / 2; j++)
@@ -149,5 +150,5 @@
 					parent2 = pop[i];
 				}  
-				else
+				if (parent1 != null && parent2 != null)
 				{
 					reproduce_haploid(parent1, parent2, 0);
@@ -158,6 +159,5 @@
 					parent1 = null;
 					parent2 = null;
-				}
-      		
+				}	
    			} 
 		}
@@ -204,4 +204,6 @@
 }
 
+
+
 function foramReproduce(cr)
 {
@@ -231,5 +233,5 @@
 		}
 		if (reproduced == 1)
-				return;
+				return 1;
 	}
 
@@ -239,4 +241,6 @@
 		cr.user2["reproduce"] = 0; 
 	}
+
+	return 0;
 }
 
Index: experiments/frams/foraminifera/data/scripts/foraminifera.show
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.show	(revision 429)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.show	(revision 430)
@@ -21,5 +21,5 @@
 	GLDisplay.minfps = 10;
 
-	Params = {"nutrientPop" : [5,10,15], "feedrate" : [0.001,0.0025,0.004], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1]};
+	Params = { "feedrate" : [0.05,0.1,0.2], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1]};
 }
 
@@ -27,9 +27,4 @@
 {
 	ExpParams.[param_id] = Params[param_id][ShowParams.[param_id]];
-}
-
-function ShowParams_nutrientPop_set()
-{
-	setShowParam("nutrientPop");
 }
 
@@ -57,9 +52,4 @@
 
 prop:
-id:nutrientPop
-name:Nutrients amount
-type:d 0 2 1 ~5~10~15
-
-prop:
 id:feedrate
 name:Feeding rate
