[380] | 1 | expdef:
|
---|
[406] | 2 | name:Reproduction of benthic foraminifera
|
---|
[380] | 3 | info:~
|
---|
[434] | 4 | Basic information about this simulation:
|
---|
| 5 | www.framsticks.com/foraminifera
|
---|
| 6 |
|
---|
| 7 | Technical information:
|
---|
[476] | 8 | Genes and parameter values which control reproduction are stored in data->genes and data->lifeparams fields.
|
---|
[380] | 9 |
|
---|
[476] | 10 | genes:
|
---|
[402] | 11 | genes which are not encoded in Ff genotype:
|
---|
[422] | 12 | min_repro_energy - Minimum energy necessary for reproduction
|
---|
| 13 | hibernation - Defines foram behavior in the case of no nutrients
|
---|
[380] | 14 |
|
---|
[476] | 15 | lifeparams:
|
---|
[380] | 16 | Physiological parameters of foraminifera:
|
---|
[422] | 17 | max_energy_level - maximum energy level reached so far
|
---|
[380] | 18 | gen - generation: 0 haploid, 1 diploid
|
---|
[432] | 19 | species - species: 0 not hibernating 1 hibernating
|
---|
| 20 | hibernated - 0/1 foram is/isn't hibernated
|
---|
[422] | 21 | reproduce - 0/1 foram isn't/is ready for reproduction
|
---|
[380] | 22 | ~
|
---|
| 23 | code:~
|
---|
| 24 |
|
---|
[479] | 25 | global chambers;
|
---|
[422] | 26 | global colors;
|
---|
[493] | 27 | global retColors;
|
---|
| 28 | global curColor;
|
---|
[479] | 29 | global max_chamber_volume;
|
---|
[474] | 30 | global movePerStep;
|
---|
[479] | 31 | global nutrientenergywaiting;
|
---|
| 32 | global o;
|
---|
| 33 | global reprocounter;
|
---|
[481] | 34 | global changePeriod;
|
---|
| 35 | global phase;
|
---|
[493] | 36 | global nutrientSqrCm;
|
---|
[487] | 37 | global species_genes;
|
---|
[380] | 38 |
|
---|
[406] | 39 | @include "foraminifera.inc"
|
---|
[401] | 40 |
|
---|
[380] | 41 | // -------------------------------- experiment begin --------------------------------
|
---|
| 42 |
|
---|
| 43 | function onExpDefLoad()
|
---|
| 44 | {
|
---|
| 45 | // define genotype and creature groups
|
---|
| 46 | GenePools.clear();
|
---|
| 47 | Populations.clear();
|
---|
| 48 | GenePools[0].name = "Unused";
|
---|
| 49 |
|
---|
| 50 | var pop = Populations[0];
|
---|
[421] | 51 | pop.name = "Forams";
|
---|
[380] | 52 | pop.en_assim = 0;
|
---|
[404] | 53 | pop.nnsim = 0;
|
---|
[380] | 54 | pop.enableperf = 1;
|
---|
| 55 | pop.death = 1;
|
---|
| 56 | pop.energy = 1;
|
---|
[487] | 57 | pop.selfmask = 0;
|
---|
| 58 | pop.othermask = 0;
|
---|
[401] | 59 | //pop.selfmask = 0x20002; pop.othermask = 0x10002;
|
---|
[422] | 60 | pop.perfperiod = 25;
|
---|
[487] | 61 | pop.bodysim = 0;
|
---|
[380] | 62 |
|
---|
[421] | 63 | pop = Populations.addGroup("Nutrients");
|
---|
[380] | 64 | pop.nnsim = 0;
|
---|
| 65 | pop.enableperf = 0;
|
---|
| 66 | pop.death = 1;
|
---|
| 67 | pop.energy = 1;
|
---|
[487] | 68 | pop.selfmask = 0;
|
---|
| 69 | pop.othermask = 0;
|
---|
[422] | 70 | //pop.othermask = 0x10002;
|
---|
[487] | 71 | pop.bodysim = 0;
|
---|
[380] | 72 |
|
---|
[444] | 73 | pop = Populations.addGroup("ReticulopodiaNutrients");
|
---|
[430] | 74 | pop.nnsim = 0;
|
---|
| 75 | pop.enableperf = 0;
|
---|
| 76 | pop.death = 0;
|
---|
| 77 | pop.energy = 0;
|
---|
[487] | 78 | pop.selfmask = 0;
|
---|
| 79 | pop.othermask = 0;
|
---|
| 80 | pop.bodysim = 0;
|
---|
[444] | 81 |
|
---|
[422] | 82 | //world
|
---|
| 83 | SignalView.mode = 1;
|
---|
[496] | 84 | World.wrldwat = 200;
|
---|
[493] | 85 | World.wrldsiz = micronsToFrams(100000);
|
---|
[422] | 86 | World.wrldbnd = 1;
|
---|
| 87 |
|
---|
[474] | 88 | movePerStep = getMovePerStep();
|
---|
| 89 |
|
---|
[486] | 90 | //ExpProperties.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions
|
---|
[444] | 91 |
|
---|
[487] | 92 | //ExpProperties.logging = 1; //uncomment to enable logging simulation parameters to log files
|
---|
[493] | 93 | ExpProperties.logPref = "";
|
---|
[401] | 94 |
|
---|
[487] | 95 | species_genes = [];
|
---|
| 96 |
|
---|
[554] | 97 | //morphology
|
---|
[479] | 98 | init_chambers();
|
---|
[493] | 99 | curColor = retColors[0];
|
---|
[486] | 100 | ExpProperties.zone1_range = micronsToFrams(1000);
|
---|
| 101 | ExpProperties.zone2_range = micronsToFrams(3000);
|
---|
| 102 | ExpProperties.chamber_proculus_haplo = micronsToFrams(50);
|
---|
| 103 | ExpProperties.chamber_difference_haplo = 0.0;
|
---|
| 104 | ExpProperties.chamber_proculus_diplo = micronsToFrams(20);
|
---|
| 105 | ExpProperties.chamber_difference_diplo = micronsToFrams(8);
|
---|
[479] | 106 |
|
---|
| 107 | max_chamber_volume = [Vector.new(), Vector.new()];
|
---|
[422] | 108 | for (var j = 0; j < 2; j++)
|
---|
| 109 | {
|
---|
| 110 | for (var i = 0; i < chambers[0].size; i++)
|
---|
| 111 | {
|
---|
[479] | 112 | max_chamber_volume[j].add(((volumeInMicrons(getProperty(j, "chamber_proculus")) + volumeInMicrons(getProperty(j, "chamber_proculus") + (i) * getProperty(j, "chamber_difference")))*(i+1))/2);
|
---|
[422] | 113 | }
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | //nutrients
|
---|
[486] | 117 | ExpProperties.nutrientradius = micronsToFrams(10);
|
---|
[552] | 118 | ExpProperties.energy_nut = 200 * energyFromVolume(ExpProperties.nutrientradius,1);
|
---|
[554] | 119 | nutrientSqrCm = 10;
|
---|
[493] | 120 | ExpProperties.nutrient_pop = Math.pow(framsToMicrons(World.wrldsiz)*0.0001,2)/nutrientSqrCm;
|
---|
[554] | 121 |
|
---|
[380] | 122 | ExpState.totaltestedcr = 0;
|
---|
[421] | 123 | ExpState.nutrient = "";
|
---|
[488] | 124 |
|
---|
[493] | 125 | //addSpecies({"min_repro_energies" : [4,6]});
|
---|
| 126 | //addSpecies({"min_repro_energies" : [4,8]});
|
---|
[557] | 127 |
|
---|
| 128 | //Simulator.print(create_genotype(0.1, 30)); //sample call
|
---|
| 129 | //Simulator.print(create_genotype(0.2, 30)); //sample call
|
---|
[380] | 130 | }
|
---|
| 131 |
|
---|
| 132 | @include "standard_placement.inc"
|
---|
| 133 |
|
---|
[554] | 134 | function secToSimSteps(value_in_sec){
|
---|
| 135 | return value_in_sec/ExpProperties.secPerStep;
|
---|
| 136 | }
|
---|
| 137 |
|
---|
[479] | 138 | function volumeInMicrons(radiusInFrams)
|
---|
[475] | 139 | {
|
---|
[479] | 140 | return 4.0/3.0*Math.pi*Math.pow(framsToMicrons(radiusInFrams),3);
|
---|
[475] | 141 | }
|
---|
| 142 |
|
---|
[479] | 143 | function energyFromVolume(base, isRadiusInFrams)
|
---|
| 144 | {
|
---|
| 145 | if (isRadiusInFrams == 1) //radius in frams
|
---|
| 146 | {
|
---|
[486] | 147 | return ExpProperties.picoCarbonPerMikro*volumeInMicrons(base);
|
---|
[479] | 148 | }
|
---|
| 149 | else //volume in microns
|
---|
| 150 | {
|
---|
[486] | 151 | return ExpProperties.picoCarbonPerMikro * base;
|
---|
[479] | 152 | }
|
---|
| 153 | }
|
---|
| 154 |
|
---|
[474] | 155 | function getMovePerStep()
|
---|
| 156 | {
|
---|
[486] | 157 | return micronsToFrams((ExpProperties.foramSpeedMmPerMin/60)*1000)*ExpProperties.secPerStep;
|
---|
[474] | 158 | }
|
---|
| 159 |
|
---|
[447] | 160 | function micronsToFrams(micrometers)
|
---|
[422] | 161 | {
|
---|
[493] | 162 | return micrometers*0.01;
|
---|
[422] | 163 | }
|
---|
| 164 |
|
---|
[447] | 165 | function framsToMicrons(framsworldunits)
|
---|
[445] | 166 | {
|
---|
[493] | 167 | return framsworldunits/0.01;
|
---|
[445] | 168 | }
|
---|
| 169 |
|
---|
[422] | 170 | function getProperty(gen, prop_id)
|
---|
| 171 | {
|
---|
| 172 | var ploid = "haplo";
|
---|
| 173 | if (gen == 1) ploid = "diplo";
|
---|
[486] | 174 | return ExpProperties.[prop_id + "_" + ploid];
|
---|
[422] | 175 | }
|
---|
| 176 |
|
---|
[487] | 177 | function getGene(cr, gen_id, gen_set)
|
---|
| 178 | {
|
---|
| 179 | if (cr.data->lifeparams->gen == 0)
|
---|
| 180 | return cr.data->genes[gen_id];
|
---|
| 181 | else
|
---|
| 182 | return cr.data->genes[gen_set][gen_id];
|
---|
| 183 | }
|
---|
| 184 |
|
---|
[479] | 185 | function addForam(species, iter, chambernum, ploid)
|
---|
[422] | 186 | {
|
---|
[496] | 187 | var geno = createForamMorphology(ploid, ploid, chambernum);
|
---|
[493] | 188 | curColor = retColors[ploid];
|
---|
[422] | 189 | var cr = Populations[0].add(geno);
|
---|
[479] | 190 | cr.name = "Initial creature" + species + "_" + iter;
|
---|
[422] | 191 | placeCreatureRandomly(cr, 0, 0);
|
---|
[479] | 192 | cr.energy0 = energyFromVolume(max_chamber_volume[ploid][chambernum],0);
|
---|
[422] | 193 | cr.energy = cr.energy0;
|
---|
[554] | 194 | setGenotype({"opt" : "birth", "cr" : cr, "gen" : ploid, "species" : species, "energy0" : cr.energy0, "genes" : species_genes[species]});
|
---|
[479] | 195 | if (ploid == 1)
|
---|
| 196 | {
|
---|
| 197 | cr.data->genes = [cr.data->genes, cr.data->genes]; //TODO two different genes sets
|
---|
| 198 | }
|
---|
[525] | 199 | moveReticulopodia(cr);
|
---|
[422] | 200 | }
|
---|
| 201 |
|
---|
[479] | 202 | function addInitialForam(species, iter)
|
---|
| 203 | {
|
---|
| 204 | var ploid = 0;
|
---|
| 205 | if (Math.rnd01 > 0.5)
|
---|
| 206 | {
|
---|
| 207 | ploid = 1;
|
---|
| 208 | }
|
---|
[493] | 209 | //add new foram with random energy bewtween starting energy and reproduction threshold
|
---|
[488] | 210 | addForam(species, iter, int(Math.rndUni(0,species_genes[species]->min_repro_energies[ploid])),ploid);
|
---|
[479] | 211 | }
|
---|
| 212 |
|
---|
[487] | 213 | //new species can be added as a dictionary with parameter values that are different than default values
|
---|
| 214 | function addSpecies(new_genes)
|
---|
| 215 | {
|
---|
[493] | 216 | species_genes.add({"min_repro_energies" : [ExpProperties.min_repro_energ_haplo,ExpProperties.min_repro_energ_diplo], "energies0" : [ExpProperties.energies0_haplo, ExpProperties.energies0_diplo], "hibernation" : 0, "morphotype" : 0});
|
---|
[487] | 217 | for (var i = 0; i < new_genes.size; i++)
|
---|
| 218 | {
|
---|
| 219 | var key = new_genes.getKey(i);
|
---|
| 220 | species_genes[species_genes.size-1][key] = new_genes[key];
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 |
|
---|
[380] | 224 | function onExpInit()
|
---|
| 225 | {
|
---|
| 226 | Populations[0].clear();
|
---|
| 227 | Populations[1].clear();
|
---|
[444] | 228 | Populations[2].clear(); //reticulopodia and nutrients
|
---|
[380] | 229 |
|
---|
[487] | 230 | if (species_genes.size == 0)
|
---|
[380] | 231 | {
|
---|
[487] | 232 | addSpecies({}); //default
|
---|
[380] | 233 | }
|
---|
[487] | 234 |
|
---|
| 235 | for (var spec = 0; spec < species_genes.size; spec++)
|
---|
| 236 | {
|
---|
| 237 | for (var i = 0; i < ExpProperties.foramPop; i++)
|
---|
| 238 | {
|
---|
| 239 | addInitialForam(spec, i);
|
---|
| 240 | }
|
---|
| 241 | }
|
---|
[422] | 242 | o = Populations[0][0].getMechPart(0).orient.clone();
|
---|
[380] | 243 | ExpState.totaltestedcr = 0;
|
---|
[554] | 244 |
|
---|
| 245 | reprocounter = 0;
|
---|
| 246 | nutrientenergywaiting = 0;
|
---|
| 247 | changePeriod = 0;
|
---|
| 248 | phase = "low";
|
---|
[380] | 249 | }
|
---|
| 250 |
|
---|
| 251 | function onExpLoad()
|
---|
| 252 | {
|
---|
| 253 | for (var pop in Populations)
|
---|
| 254 | pop.clear();
|
---|
| 255 |
|
---|
| 256 | Loader.addClass(sim_params.*);
|
---|
| 257 | Loader.setBreakLabel(Loader.BeforeUnknown, "onExpLoad_Unknown");
|
---|
| 258 | Loader.run();
|
---|
| 259 |
|
---|
[421] | 260 | Simulator.print("Loaded " + Populations[0].size + " Forams and " + Populations[1].size + " nutrient objects");
|
---|
[380] | 261 | }
|
---|
| 262 |
|
---|
| 263 | function onExpLoad_Unknown()
|
---|
| 264 | {
|
---|
| 265 | if (Loader.objectName == "org") // saved by the old expdef
|
---|
| 266 | {
|
---|
| 267 | var g = Genotype.newFromString("");
|
---|
| 268 | Loader.currentObject = g;
|
---|
| 269 | Interface.makeFrom(g).setAllDefault();
|
---|
| 270 | Loader.loadObject();
|
---|
| 271 | var cr = Populations[0].add(g);
|
---|
| 272 | if (cr != null)
|
---|
| 273 | {
|
---|
[401] | 274 | //cr.rotate(0,0,Math.rnd01*Math.twopi);
|
---|
[476] | 275 | if ((typeof(g.data->genes) == "Vector") && (g.data->genes.size >= 3))
|
---|
[401] | 276 | {
|
---|
| 277 | // [x,y,energy]
|
---|
[476] | 278 | cr.move(g.data->genes[0] - cr.center_x, g.data->genes[1] - cr.center_y, 0);
|
---|
| 279 | cr.energy = g.data->genes[2];
|
---|
[380] | 280 | }
|
---|
| 281 | else
|
---|
| 282 | {
|
---|
[401] | 283 | cr.move(Math.rnd01 * World.wrldsiz - cr.center_x, Math.rnd01 * World.wrldsiz - cr.center_y, 0);
|
---|
[380] | 284 | }
|
---|
| 285 | }
|
---|
| 286 | }
|
---|
| 287 | else if (Loader.objectName == "Creature")
|
---|
| 288 | {
|
---|
| 289 | Loader.currentObject = CreatureSnapshot.new();
|
---|
| 290 | Loader.loadObject();
|
---|
| 291 | Populations[0].add(Loader.currentObject);
|
---|
| 292 | }
|
---|
| 293 | }
|
---|
| 294 |
|
---|
| 295 | function onExpSave()
|
---|
| 296 | {
|
---|
| 297 | File.writeComment("saved by '%s.expdef'" % Simulator.expdef);
|
---|
| 298 |
|
---|
[401] | 299 | var tmpvec = [], i;
|
---|
[380] | 300 |
|
---|
[401] | 301 | for(var cr in Populations[1])
|
---|
[380] | 302 | tmpvec.add([cr.center_x, cr.center_y, cr.energy]);
|
---|
| 303 |
|
---|
[421] | 304 | ExpState.nutrient = tmpvec;
|
---|
[380] | 305 | File.writeObject(sim_params.*);
|
---|
[432] | 306 | ExpState.nutrient = null; //vectors are only created for saving and then discarded
|
---|
[380] | 307 |
|
---|
| 308 | for (var cr in Populations[0])
|
---|
| 309 | File.writeObject(cr);
|
---|
| 310 | }
|
---|
| 311 |
|
---|
| 312 | // -------------------------------- experiment end --------------------------------
|
---|
| 313 |
|
---|
[421] | 314 | // -------------------------------- foram begin -----------------------------------
|
---|
[380] | 315 |
|
---|
[479] | 316 | function setForamMeta(cr)
|
---|
[430] | 317 | {
|
---|
[479] | 318 | //percent of current energy
|
---|
[486] | 319 | cr.idleen = (ExpProperties.e_meta * cr.energy)*ExpProperties.secPerStep;
|
---|
[430] | 320 | }
|
---|
| 321 |
|
---|
| 322 | function lastChamberNum(cr)
|
---|
| 323 | {
|
---|
| 324 | return cr.numparts-1;
|
---|
| 325 | }
|
---|
| 326 |
|
---|
[479] | 327 | function getZoneRange(cr, zone_num)
|
---|
| 328 | {
|
---|
[486] | 329 | return ExpProperties.["zone"+zone_num+"_range"];
|
---|
[479] | 330 | }
|
---|
| 331 |
|
---|
[421] | 332 | function onForamsBorn(cr)
|
---|
| 333 | {
|
---|
[479] | 334 | setForamMeta(cr);
|
---|
[486] | 335 | if (ExpProperties.visualize == 1)
|
---|
[430] | 336 | {
|
---|
[506] | 337 | var ret = Populations[2].add("//0\nm:Vstyle=reticulopodia\np:sh=1,sx=0.001,sy=0.001,sz=0.001\np:sh=3,sx=0.01,sy="+getZoneRange(cr,1)+",sz="+getZoneRange(cr,1)+",ry=1.57079633,vr="+curColor+"\nj:0, 1, sh=1");
|
---|
[476] | 338 | cr.data->reticulopodiacreature = ret;
|
---|
[506] | 339 | ret.getMechPart(0).orient.set(cr.getMechPart(0).orient);
|
---|
[496] | 340 | ret.moveAbs(cr.center_x-getZoneRange(cr,1), cr.center_y-getZoneRange(cr,1), cr.center_z-getZoneRange(cr,1));
|
---|
[430] | 341 | }
|
---|
[380] | 342 | }
|
---|
| 343 |
|
---|
[401] | 344 | function placeRandomlyNotColliding(cr)
|
---|
| 345 | {
|
---|
| 346 | var retry = 100; //try 100 times
|
---|
| 347 | while (retry--)
|
---|
| 348 | {
|
---|
| 349 | placeCreatureRandomly(cr, 0, 0);
|
---|
| 350 | if (!cr.boundingBoxCollisions(0))
|
---|
| 351 | return cr;
|
---|
| 352 | }
|
---|
| 353 |
|
---|
| 354 | Populations[0].delete(cr);
|
---|
| 355 | }
|
---|
| 356 |
|
---|
[444] | 357 | function visualization(cr)
|
---|
| 358 | {
|
---|
| 359 | var has_ret = 0;
|
---|
| 360 |
|
---|
[476] | 361 | if (cr.data->reticulopodiacreature != null)
|
---|
[444] | 362 | {
|
---|
[476] | 363 | if (Populations[2].findUID(cr.data->reticulopodiacreature.uid) != null)
|
---|
[444] | 364 | {
|
---|
| 365 | has_ret = 1;
|
---|
| 366 | }
|
---|
| 367 | }
|
---|
| 368 |
|
---|
| 369 | return has_ret;
|
---|
| 370 | }
|
---|
| 371 |
|
---|
[422] | 372 | function foramGrow(cr, chamber_num)
|
---|
[380] | 373 | {
|
---|
[476] | 374 | if ((chamber_num+1) < chambers[cr.data->lifeparams->species].size)
|
---|
[474] | 375 | {
|
---|
[493] | 376 | curColor = retColors[cr.data->lifeparams->gen];
|
---|
[496] | 377 | var geno = createForamMorphology(cr.data->lifeparams->gen, cr.data->lifeparams->gen, chamber_num+1);
|
---|
[474] | 378 | var cr2 = Populations[0].add(geno);
|
---|
[422] | 379 |
|
---|
[474] | 380 | cr2.energy0 = cr.energy;
|
---|
| 381 | cr2.energy = cr2.energy0;
|
---|
[422] | 382 |
|
---|
[554] | 383 | setGenotype({"cr" : cr2, "parent_genes" : cr.data->genes, "parent_lifeparams" : cr.data->lifeparams, "opt" : "growth", "energy0" : cr.energy0});
|
---|
[474] | 384 | cr2.moveAbs(cr.center_x - cr2.size_x / 2, cr.center_y - cr2.size_y / 2, cr.pos_z);
|
---|
[479] | 385 | setForamMeta(cr2);
|
---|
[422] | 386 |
|
---|
[474] | 387 | if (visualization(cr))
|
---|
| 388 | {
|
---|
[476] | 389 | Populations[2].delete(cr.data->reticulopodiacreature);
|
---|
[474] | 390 | }
|
---|
| 391 | Populations[0].delete(cr);
|
---|
[430] | 392 | }
|
---|
[380] | 393 | }
|
---|
| 394 |
|
---|
[435] | 395 | function stepToNearest(cr)
|
---|
[380] | 396 | {
|
---|
| 397 | var p = cr.getMechPart(0);
|
---|
[479] | 398 | var n = cr.signals.receiveSet("nutrient", getZoneRange(cr,2));
|
---|
[380] | 399 |
|
---|
[401] | 400 | //if signals are received find the source of the nearest
|
---|
[380] | 401 | if (n.size > 0)
|
---|
| 402 | {
|
---|
| 403 | var i;
|
---|
| 404 | var mp;
|
---|
| 405 | var distvec = XYZ.new(0, 0, 0);
|
---|
| 406 | var dist;
|
---|
[470] | 407 | var mindist = 100000000000.0;
|
---|
[380] | 408 | var mindistvec = null;
|
---|
[430] | 409 | var eating = 0;
|
---|
[380] | 410 |
|
---|
[401] | 411 | for (i = 0; i < n.size; i++)
|
---|
[380] | 412 | {
|
---|
[430] | 413 | mp = n[i].value.getMechPart(0);
|
---|
[401] | 414 | distvec.set(mp.pos);
|
---|
| 415 | distvec.sub(p.pos);
|
---|
| 416 | dist = distvec.length;
|
---|
[479] | 417 | if (dist < getZoneRange(cr,1))
|
---|
[380] | 418 | {
|
---|
[430] | 419 | if (n[i].value != null)
|
---|
| 420 | {
|
---|
| 421 | energyTransfer(cr, n[i].value);
|
---|
| 422 | eating = 1;
|
---|
| 423 | }
|
---|
| 424 | }
|
---|
[476] | 425 | else if (eating == 0 && cr.data->lifeparams->hibernated == 0 && dist < mindist)
|
---|
[430] | 426 | {
|
---|
[401] | 427 | mindist = dist;
|
---|
| 428 | mindistvec = distvec.clone();
|
---|
[380] | 429 | }
|
---|
| 430 | }
|
---|
| 431 |
|
---|
[476] | 432 | if (!eating && cr.data->lifeparams->hibernated == 0)
|
---|
[430] | 433 | {
|
---|
| 434 | mindistvec.normalize();
|
---|
[474] | 435 | mindistvec.scale(-1*movePerStep);
|
---|
[430] | 436 | cr.localDrive = mindistvec;
|
---|
| 437 | moveEnergyDec(cr);
|
---|
| 438 | }
|
---|
| 439 |
|
---|
[422] | 440 | return 1;
|
---|
[380] | 441 | }
|
---|
[422] | 442 |
|
---|
| 443 | else
|
---|
[474] | 444 | {
|
---|
[422] | 445 | return 0;
|
---|
[474] | 446 | }
|
---|
[422] | 447 | }
|
---|
[401] | 448 |
|
---|
[422] | 449 | function moveEnergyDec(cr)
|
---|
| 450 | {
|
---|
[476] | 451 | if (cr.data->lifeparams->hibernated == 0)
|
---|
[422] | 452 | {
|
---|
[479] | 453 | //percent of maximal energy
|
---|
[504] | 454 | cr.energy -= (ExpProperties.energy_move * cr.data->lifeparams->max_energy_level)*ExpProperties.secPerStep;
|
---|
[422] | 455 | }
|
---|
[421] | 456 | }
|
---|
[380] | 457 |
|
---|
[493] | 458 | function fence(pos, zone)
|
---|
[487] | 459 | {
|
---|
[496] | 460 | return Math.min(Math.max(0,pos),World.wrldsiz);
|
---|
[487] | 461 | }
|
---|
| 462 |
|
---|
[422] | 463 | function foramMove(cr)
|
---|
[421] | 464 | {
|
---|
[422] | 465 | //TODO moving inside sediment?
|
---|
[421] | 466 |
|
---|
[422] | 467 | //adjustment in z axis
|
---|
[554] | 468 | var change_direction = 0;
|
---|
| 469 | var new_x = fence(cr.pos_x, getZoneRange(cr, 1));
|
---|
| 470 | var new_y = fence(cr.pos_y,getZoneRange(cr, 1));
|
---|
[421] | 471 |
|
---|
[554] | 472 | if ((new_x != cr.pos_x) || (new_y != cr.pos_y) || (cr.data->lifeparams->dir_counter >= int(secToSimSteps(ExpProperties.dir_change_sec))))
|
---|
| 473 | {
|
---|
| 474 | change_direction = 1;
|
---|
| 475 | }
|
---|
| 476 |
|
---|
| 477 | cr.moveAbs(new_x, new_y, 0);
|
---|
| 478 |
|
---|
[430] | 479 | //are there any nutrients in zone 1 or 2?
|
---|
[401] | 480 | {
|
---|
[435] | 481 | var moved = stepToNearest(cr); //TODO weighted sum of distance and energy
|
---|
[422] | 482 | if (moved==1)
|
---|
[430] | 483 | {
|
---|
[502] | 484 | moveReticulopodia(cr);
|
---|
[422] | 485 | return;
|
---|
| 486 | }
|
---|
[401] | 487 | }
|
---|
| 488 |
|
---|
[422] | 489 | //no nutrients in zone 2
|
---|
[487] | 490 | if (getGene(cr, "hibernation",0) == 1)
|
---|
[401] | 491 | {
|
---|
[430] | 492 | reverseHib(cr);
|
---|
[422] | 493 | cr.localDrive = XYZ.new(0,0,0);
|
---|
[380] | 494 | }
|
---|
[422] | 495 | //random move
|
---|
[554] | 496 | else if (change_direction == 1)
|
---|
[380] | 497 | {
|
---|
[476] | 498 | cr.data->lifeparams->dir = randomDir();
|
---|
[552] | 499 | cr.data->lifeparams->dir_counter = 0;
|
---|
[476] | 500 | cr.localDrive = cr.data->lifeparams->dir;
|
---|
[422] | 501 | moveEnergyDec(cr);
|
---|
| 502 | }
|
---|
[474] | 503 | else
|
---|
| 504 | {
|
---|
[476] | 505 | cr.localDrive = cr.data->lifeparams->dir;
|
---|
[474] | 506 | }
|
---|
[502] | 507 | moveReticulopodia(cr);
|
---|
[422] | 508 | }
|
---|
[401] | 509 |
|
---|
[502] | 510 | function moveReticulopodia(cr)
|
---|
| 511 | {
|
---|
| 512 | if (visualization(cr))
|
---|
| 513 | {
|
---|
| 514 | cr.data->reticulopodiacreature.moveAbs(cr.center_x-getZoneRange(cr,1), cr.center_y-getZoneRange(cr,1), cr.center_z-getZoneRange(cr,1));
|
---|
| 515 | cr.data->reticulopodiacreature.localDrive = cr.localDrive;
|
---|
| 516 | }
|
---|
| 517 | }
|
---|
| 518 |
|
---|
[474] | 519 | function randomDir()
|
---|
| 520 | {
|
---|
[486] | 521 | var dir = (Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), 0);
|
---|
[474] | 522 | dir.normalize();
|
---|
| 523 | dir.scale(-1*movePerStep);
|
---|
| 524 | return dir;
|
---|
| 525 | }
|
---|
| 526 |
|
---|
[430] | 527 | function energyTransfer(cr1, cr2)
|
---|
[422] | 528 | {
|
---|
[430] | 529 | cr1.localDrive = XYZ.new(0,0,0);
|
---|
[510] | 530 | var e = ExpProperties.feedtrans*cr1.energy*ExpProperties.secPerStep; //TODO efficiency dependent on age
|
---|
[502] | 531 | //Simulator.print("transferring "+e +"("+e*ExpProperties.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.uid+" ("+cr2.energy+") "+ e/ExpProperties.secPerStep+ " per sec");
|
---|
[510] | 532 | var transferred = cr2.transferEnergyTo(cr1, e);
|
---|
| 533 | cr1.energy -= transferred*(1-ExpProperties.ingestion);
|
---|
[476] | 534 | if (cr1.data->lifeparams->hibernated == 1)
|
---|
[422] | 535 | {
|
---|
[430] | 536 | reverseHib(cr1);
|
---|
[422] | 537 | }
|
---|
| 538 | }
|
---|
[401] | 539 |
|
---|
[430] | 540 | function reverseHib(cr)
|
---|
| 541 | {
|
---|
[476] | 542 | if (cr.data->lifeparams->hibernated == 1)
|
---|
[430] | 543 | {
|
---|
[479] | 544 | setForamMeta(cr); //unhibernate
|
---|
[430] | 545 | }
|
---|
| 546 | else
|
---|
| 547 | {
|
---|
[486] | 548 | cr.idleen = (ExpProperties.energy_hib * cr.energy)*ExpProperties.secPerStep; //hibernate
|
---|
[430] | 549 | }
|
---|
[476] | 550 | cr.data->lifeparams->hibernated = 1 - cr.data->lifeparams->hibernated;
|
---|
[430] | 551 | }
|
---|
| 552 |
|
---|
[493] | 553 | function createLogVector(cr, value)
|
---|
| 554 | {
|
---|
| 555 | var vec = Vector.new();
|
---|
| 556 | for (var i = 0; i < species_genes.size; i++)
|
---|
| 557 | {
|
---|
| 558 | for (var j = 0; j < 2; j++)
|
---|
| 559 | {
|
---|
| 560 | vec.add(0);
|
---|
| 561 | }
|
---|
| 562 | if (cr.data->lifeparams->species == i)
|
---|
| 563 | {
|
---|
| 564 | vec[i*2+cr.data->lifeparams->gen] = value;
|
---|
| 565 | }
|
---|
| 566 | }
|
---|
| 567 | return vec;
|
---|
| 568 | }
|
---|
[479] | 569 |
|
---|
[422] | 570 | function onForamsStep(cr)
|
---|
| 571 | {
|
---|
[479] | 572 | //checking for gametogenesis process
|
---|
| 573 | if (cr.data->lifeparams->division_time > 0)
|
---|
[444] | 574 | {
|
---|
[479] | 575 | cr.data->lifeparams->division_time = Math.max(cr.data->lifeparams->division_time-1,0);
|
---|
[444] | 576 | }
|
---|
[479] | 577 | //checking for end of gametogenesis
|
---|
| 578 | else if (cr.data->lifeparams->division_time == 0)
|
---|
[422] | 579 | {
|
---|
[479] | 580 | //waiting for gamets fusion
|
---|
[422] | 581 | }
|
---|
[479] | 582 | //checking for chamber growth process
|
---|
| 583 | else if (cr.data->lifeparams->chamber_growth > 0)
|
---|
| 584 | {
|
---|
| 585 | cr.data->lifeparams->chamber_growth = Math.max(cr.data->lifeparams->chamber_growth-1,0);
|
---|
[486] | 586 | //Simulator.print("chamber growing, time left = " + cr.data->lifeparams->chamber_growth*ExpProperties.secPerStep);
|
---|
[504] | 587 | cr.energy -= ExpProperties.chamberCostPerSec * cr.energy * ExpProperties.secPerStep;
|
---|
[422] | 588 |
|
---|
[479] | 589 | //Simulator.print("energy " + cr2.energy + " subtracting " + growth_cost);
|
---|
| 590 | }
|
---|
| 591 | //checking for end of chamber growth process
|
---|
| 592 | else if (cr.data->lifeparams->chamber_growth == 0)
|
---|
[430] | 593 | {
|
---|
[479] | 594 | foramGrow(cr, lastChamberNum(cr));
|
---|
| 595 | cr.data->lifeparams->chamber_growth = -1;
|
---|
| 596 | //Simulator.print("chamber "+ (lastChamberNum(cr) + 1) +" complete");
|
---|
[430] | 597 | }
|
---|
[479] | 598 | else
|
---|
[422] | 599 | {
|
---|
[479] | 600 | //update of metabolism rate
|
---|
| 601 | if (cr.data->lifeparams->hibernated == 0)
|
---|
[401] | 602 | {
|
---|
[479] | 603 | setForamMeta(cr);
|
---|
| 604 | }
|
---|
| 605 |
|
---|
| 606 | cr.getMechPart(0).orient.set(o);
|
---|
| 607 |
|
---|
| 608 | if (deathConditions(cr) == 1)
|
---|
| 609 | {
|
---|
[493] | 610 | if (ExpProperties.logging == 1)
|
---|
| 611 | {
|
---|
| 612 | log(createLogVector(cr, cr.data->lifeparams->max_energy_level),ExpProperties.logPref+"fossil_log.txt");
|
---|
[552] | 613 | log(createLogVector(cr, cr.lifespan),ExpProperties.logPref+"lifespan_log.txt");
|
---|
[493] | 614 | }
|
---|
[479] | 615 | Populations[0].kill(cr);
|
---|
| 616 | return;
|
---|
| 617 | }
|
---|
| 618 |
|
---|
[552] | 619 | //update direction change counter
|
---|
| 620 | cr.data->lifeparams->dir_counter += 1;
|
---|
| 621 |
|
---|
[479] | 622 | foramMove(cr);
|
---|
| 623 |
|
---|
| 624 | var repro = foramReproduce(cr);
|
---|
| 625 | if (repro == 1)
|
---|
| 626 | {
|
---|
| 627 | return;
|
---|
| 628 | }
|
---|
| 629 |
|
---|
| 630 | cr.data->lifeparams->max_energy_level = Math.max(cr.energy, cr.data->lifeparams->max_energy_level);
|
---|
| 631 |
|
---|
| 632 | //cheking conditions of chamber growth process start
|
---|
| 633 | if (lastChamberNum(cr) != chambers[0].size-1)
|
---|
| 634 | {
|
---|
| 635 | if ((cr.data->lifeparams->max_energy_level >= energyFromVolume(max_chamber_volume[cr.data->lifeparams->gen][lastChamberNum(cr)],0)))
|
---|
| 636 | {
|
---|
[554] | 637 | cr.data->lifeparams->chamber_growth = int(secToSimSteps(ExpProperties.chamberGrowthSec));
|
---|
[479] | 638 | }
|
---|
| 639 | }
|
---|
[430] | 640 | }
|
---|
[380] | 641 | }
|
---|
| 642 |
|
---|
[422] | 643 | function deathConditions(cr)
|
---|
| 644 | {
|
---|
[486] | 645 | if ((cr.energy <= getProperty(cr.data->lifeparams->gen,"e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpProperties.hunted_prob))
|
---|
[479] | 646 | {
|
---|
[422] | 647 | return 1;
|
---|
[479] | 648 | }
|
---|
[422] | 649 | else
|
---|
| 650 | return 0;
|
---|
| 651 | }
|
---|
| 652 |
|
---|
[421] | 653 | function onForamsDied(cr)
|
---|
[380] | 654 | {
|
---|
[444] | 655 | if (visualization(cr))
|
---|
[430] | 656 | {
|
---|
[476] | 657 | Populations[2].delete(cr.data->reticulopodiacreature);
|
---|
[430] | 658 | }
|
---|
[380] | 659 | //fossilization
|
---|
| 660 | var geno = GenePools[0].add(cr.genotype);
|
---|
[476] | 661 | geno.data->genes = cr.data->genes;
|
---|
| 662 | geno.data->lifeparams = cr.data->lifeparams;
|
---|
[486] | 663 | if (ExpProperties.logging == 1) Simulator.print("\"" + cr.name + "\" died...");
|
---|
[380] | 664 | ExpState.totaltestedcr++;
|
---|
| 665 | }
|
---|
| 666 |
|
---|
[421] | 667 | // --------------------------------foram end -------------------------------------
|
---|
[380] | 668 |
|
---|
[421] | 669 | // -------------------------------- nutrient begin --------------------------------
|
---|
[380] | 670 |
|
---|
[479] | 671 | function createNutrientGenotype(nutrientradius)
|
---|
[422] | 672 | {
|
---|
[524] | 673 | return "//0\nm:Vstyle=nutrient\np:sh=3,sx="+nutrientradius+",sy="+nutrientradius+",sz="+nutrientradius+",ry=1.57,vr=0.0,1.0,0.0";
|
---|
[422] | 674 | }
|
---|
| 675 |
|
---|
[421] | 676 | function onNutrientsStep(cr)
|
---|
[380] | 677 | {
|
---|
[444] | 678 | cr.moveAbs(cr.pos_x % World.wrldsiz, cr.pos_y % World.wrldsiz, 0.5);
|
---|
[380] | 679 | }
|
---|
| 680 |
|
---|
[421] | 681 | function addNutrient()
|
---|
[380] | 682 | {
|
---|
[486] | 683 | var cr = Populations[1].add(createNutrientGenotype(ExpProperties.nutrientradius));
|
---|
[380] | 684 |
|
---|
[421] | 685 | cr.name = "Nutrients";
|
---|
[380] | 686 | cr.idleen = 0;
|
---|
[486] | 687 | cr.energy0 = ExpProperties.energy_nut;
|
---|
[416] | 688 | cr.energy = cr.energy0;
|
---|
[421] | 689 | cr.signals.add("nutrient");
|
---|
[380] | 690 |
|
---|
[430] | 691 | cr.signals[0].value = cr;
|
---|
[380] | 692 |
|
---|
[422] | 693 | placeCreatureRandomly(cr, 0, 0);
|
---|
[486] | 694 | if (ExpProperties.visualize == 1)
|
---|
[444] | 695 | {
|
---|
[486] | 696 | var nutsize = ExpProperties.nutrientradius*10;
|
---|
[555] | 697 | var nut = Populations[2].add("//0\nm:Vstyle=nutrient_visual\np:sh=2,sx="+nutsize+",sy="+nutsize+",sz="+nutsize+",ry=1.5,vr=0.0,1.0,0.0");
|
---|
[476] | 698 | cr.data->reticulopodiacreature = nut;
|
---|
[444] | 699 | nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, 0.5);
|
---|
| 700 | }
|
---|
[380] | 701 | }
|
---|
| 702 |
|
---|
[444] | 703 | function onNutrientsDied(cr)
|
---|
| 704 | {
|
---|
| 705 | if (visualization(cr))
|
---|
| 706 | {
|
---|
[476] | 707 | Populations[2].delete(cr.data->reticulopodiacreature);
|
---|
[444] | 708 | }
|
---|
| 709 | }
|
---|
| 710 |
|
---|
[422] | 711 | function nutrientGrowth()
|
---|
[380] | 712 | {
|
---|
[486] | 713 | if (ExpProperties.foodPeriodChange > 0)
|
---|
[481] | 714 | {
|
---|
| 715 | changePeriod += 1;
|
---|
[554] | 716 | if (phase=="low" && changePeriod >= secToSimSteps(23328000)) //9 months
|
---|
[481] | 717 | {
|
---|
[486] | 718 | ExpProperties.foodperiod = ExpProperties.foodperiod/ExpProperties.foodPeriodChange;
|
---|
[481] | 719 | phase = "high";
|
---|
| 720 | changePeriod = 0;
|
---|
| 721 | }
|
---|
| 722 |
|
---|
[554] | 723 | else if (phase == "high" && changePeriod >= secToSimSteps(7776000)) //3 months
|
---|
[481] | 724 | {
|
---|
[486] | 725 | ExpProperties.foodperiod = ExpProperties.foodperiod*ExpProperties.foodPeriodChange;
|
---|
[481] | 726 | phase = "low";
|
---|
| 727 | changePeriod = 0;
|
---|
| 728 | }
|
---|
| 729 | }
|
---|
[474] | 730 | nutrientenergywaiting = nutrientenergywaiting + 1;
|
---|
[554] | 731 | if (nutrientenergywaiting >= secToSimSteps(ExpProperties.foodperiod))
|
---|
[380] | 732 | {
|
---|
[493] | 733 | for (var i = 0; i < ExpProperties.nutrient_pop; i++)
|
---|
[432] | 734 | {
|
---|
[422] | 735 | addNutrient();
|
---|
| 736 | }
|
---|
| 737 |
|
---|
| 738 | nutrientenergywaiting = 0.0;
|
---|
| 739 | Simulator.checkpoint();
|
---|
[493] | 740 |
|
---|
| 741 | if (ExpProperties.logging == 1)
|
---|
| 742 | {
|
---|
| 743 | log([ExpProperties.nutrient_pop],ExpProperties.logPref+"nutrients_log.txt");
|
---|
| 744 | }
|
---|
[380] | 745 | }
|
---|
[493] | 746 |
|
---|
[380] | 747 | }
|
---|
| 748 |
|
---|
[421] | 749 | // -------------------------------- nutrient end --------------------------------
|
---|
[380] | 750 |
|
---|
[422] | 751 | // -------------------------------- step begin --------------------------------
|
---|
[380] | 752 |
|
---|
[422] | 753 | function onStep()
|
---|
| 754 | {
|
---|
[432] | 755 |
|
---|
| 756 | nutrientGrowth();
|
---|
[486] | 757 | if (ExpProperties.logging == 1)
|
---|
[422] | 758 | {
|
---|
| 759 | createStatistics();
|
---|
| 760 | }
|
---|
| 761 |
|
---|
| 762 | //reproduction --------------------------------------------
|
---|
| 763 | reprocounter += 1;
|
---|
[554] | 764 | if (reprocounter > secToSimSteps(ExpProperties.reproTimeSec))
|
---|
[422] | 765 | {
|
---|
| 766 | reprocounter = 0;
|
---|
| 767 | reproduce_parents(0);
|
---|
| 768 | reproduce_parents(1);
|
---|
| 769 | }
|
---|
| 770 |
|
---|
| 771 | //check for extinction -----------------------------------------------
|
---|
| 772 | if (Populations[0].size == 0)
|
---|
| 773 | {
|
---|
[486] | 774 | if (ExpProperties.autorestart)
|
---|
[422] | 775 | {
|
---|
| 776 | Simulator.print("no more creatures, restarting...");
|
---|
| 777 | onExpInit();
|
---|
| 778 | }
|
---|
| 779 | else
|
---|
| 780 | {
|
---|
| 781 | Simulator.print("no more creatures, stopped.");
|
---|
| 782 | Simulator.stop();
|
---|
| 783 | }
|
---|
| 784 | }
|
---|
[486] | 785 | if (ExpProperties.maxSteps > 0)
|
---|
[432] | 786 | {
|
---|
[486] | 787 | if (Simulator.stepNumber >= ExpProperties.maxSteps)
|
---|
[432] | 788 | Simulator.stop();
|
---|
| 789 | }
|
---|
[422] | 790 | }
|
---|
| 791 |
|
---|
| 792 | function createStatistics()
|
---|
| 793 | {
|
---|
[487] | 794 | var number = [];
|
---|
| 795 | var e_inc = [];
|
---|
[422] | 796 | var e_nut = 0.0;
|
---|
| 797 |
|
---|
[487] | 798 | for (var s = 0; s < species_genes.size; s++)
|
---|
| 799 | {
|
---|
| 800 | number.add([0,0]);// [haplo][diplo]
|
---|
| 801 | e_inc.add([0,0]);
|
---|
| 802 | }
|
---|
| 803 |
|
---|
[422] | 804 | for (var i = 0; i < Populations[0].size; i++)
|
---|
| 805 | {
|
---|
| 806 | var cr = Populations[0].get(i);
|
---|
[476] | 807 | var gen = cr.data->lifeparams->gen;
|
---|
| 808 | var species = cr.data->lifeparams->species;
|
---|
[430] | 809 |
|
---|
| 810 | number[species][gen] = number[species][gen] + 1;
|
---|
| 811 | e_inc[species][gen] = e_inc[species][gen] + cr.energy;
|
---|
[422] | 812 | }
|
---|
| 813 |
|
---|
| 814 | for (var i = 0; i < Populations[1].size; i++)
|
---|
| 815 | {
|
---|
| 816 | var cr = Populations[1].get(i);
|
---|
| 817 | e_nut += cr.energy;
|
---|
| 818 | }
|
---|
| 819 |
|
---|
[487] | 820 | var log_numbers = [];
|
---|
| 821 | var log_energies = [];
|
---|
[422] | 822 |
|
---|
[487] | 823 | for (var s = 0; s < species_genes.size; s++)
|
---|
| 824 | {
|
---|
| 825 | for (var p = 0; p < 2; p++)
|
---|
| 826 | {
|
---|
| 827 | log_numbers.add(number[s][p]);
|
---|
| 828 | log_energies.add(e_inc[s][p]);
|
---|
| 829 | }
|
---|
| 830 | }
|
---|
| 831 |
|
---|
| 832 | log_numbers.add(Populations[1].size);
|
---|
| 833 | log_energies.add(e_nut);
|
---|
| 834 |
|
---|
[493] | 835 | log(log_numbers, ExpProperties.logPref+"forams_log.txt");
|
---|
| 836 | log(log_energies, ExpProperties.logPref+"energies_log.txt");
|
---|
[422] | 837 | }
|
---|
| 838 |
|
---|
[380] | 839 | function log(tolog, fname)
|
---|
| 840 | {
|
---|
[430] | 841 | var f = File.appendDirect(fname, "forams data");
|
---|
[380] | 842 | f.writeString("" + Simulator.stepNumber);
|
---|
[401] | 843 | for (var i = 0; i < tolog.size; i++)
|
---|
[380] | 844 | {
|
---|
| 845 | f.writeString(";" + tolog[i]);
|
---|
| 846 | }
|
---|
| 847 | f.writeString("\n");
|
---|
| 848 | f.close();
|
---|
| 849 | }
|
---|
| 850 |
|
---|
[422] | 851 | // -------------------------------- step end --------------------------------
|
---|
[479] | 852 | //TODO default params values in frams instead of microns/seconds
|
---|
[380] | 853 |
|
---|
[401] | 854 | @include "standard_events.inc"
|
---|
[380] | 855 |
|
---|
[401] | 856 | ~
|
---|
[380] | 857 |
|
---|
[486] | 858 | property:
|
---|
[444] | 859 | id:visualize
|
---|
| 860 | name:Show reticulopodia and nutrients
|
---|
[430] | 861 | type:d 0 1 0
|
---|
[554] | 862 | group:
|
---|
[430] | 863 |
|
---|
[486] | 864 | property:
|
---|
[434] | 865 | id:maxSteps
|
---|
[554] | 866 | name:Maximum number of steps
|
---|
[552] | 867 | type:d 0 10000000 0
|
---|
[554] | 868 | group:
|
---|
[432] | 869 |
|
---|
[486] | 870 | property:
|
---|
[554] | 871 | id:logging
|
---|
| 872 | name:Log statistics to file
|
---|
| 873 | type:d 0 1 0
|
---|
| 874 | group:
|
---|
| 875 |
|
---|
| 876 | property:
|
---|
[493] | 877 | id:logPref
|
---|
| 878 | name:Log prefix
|
---|
| 879 | type:s
|
---|
| 880 |
|
---|
| 881 | property:
|
---|
[554] | 882 | id:secPerStep
|
---|
| 883 | name:Seconds per simulation step
|
---|
| 884 | help:Number of seconds of foraminifera time per simulation step
|
---|
| 885 | type:f 1 480 300
|
---|
| 886 | flags: 16
|
---|
| 887 | group:
|
---|
| 888 |
|
---|
| 889 | property:
|
---|
[474] | 890 | id:foramSpeedMmPerMin
|
---|
| 891 | name:Speed of foraminfera in mm/min
|
---|
[554] | 892 | type:f 0.01 0.1 0.05
|
---|
[474] | 893 | flags: 16
|
---|
| 894 | group:Foraminifera
|
---|
| 895 |
|
---|
[486] | 896 | property:
|
---|
[554] | 897 | id:dir_change_sec
|
---|
| 898 | name:Number of seconds before direction change
|
---|
| 899 | type:d 300 300000 6000
|
---|
[479] | 900 | group:Foraminifera
|
---|
| 901 |
|
---|
[486] | 902 | property:
|
---|
[554] | 903 | id:foramPop
|
---|
| 904 | name:Initial forams population size
|
---|
| 905 | type:d 1 1000 20
|
---|
[552] | 906 | group:Foraminifera
|
---|
| 907 |
|
---|
| 908 | property:
|
---|
[554] | 909 | id:gametoPeriodSec
|
---|
[479] | 910 | name:Time of gametogenesis
|
---|
[554] | 911 | type:f 300 300000 21600
|
---|
| 912 | group:Reproduction
|
---|
[479] | 913 |
|
---|
[486] | 914 | property:
|
---|
[554] | 915 | id:gametSuccessRate
|
---|
| 916 | name:Ratio of successful gamets
|
---|
| 917 | type:f 0.0001 0.01 0.001
|
---|
| 918 | group:Reproduction
|
---|
[479] | 919 |
|
---|
[486] | 920 | property:
|
---|
[554] | 921 | id:divisionCost
|
---|
| 922 | name:Cost of division in pG
|
---|
| 923 | type:f 15 25 20
|
---|
| 924 | group:Reproduction
|
---|
[474] | 925 |
|
---|
[486] | 926 | property:
|
---|
[554] | 927 | id:min_repro_energ_haplo
|
---|
| 928 | name:Min reproduction energy of haploid
|
---|
| 929 | type:f 0 -1 4
|
---|
| 930 | group:Energy
|
---|
[380] | 931 |
|
---|
[486] | 932 | property:
|
---|
[554] | 933 | id:min_repro_energ_diplo
|
---|
| 934 | name:Min reproduction energy of diploid
|
---|
| 935 | type:f 0 -1 6
|
---|
| 936 | group:Energy
|
---|
[479] | 937 |
|
---|
[486] | 938 | property:
|
---|
[554] | 939 | id:repro_prob
|
---|
| 940 | name:Probability of reproduction
|
---|
| 941 | type:f 0 1 0.8
|
---|
| 942 | group:Reproduction
|
---|
[380] | 943 |
|
---|
[486] | 944 | property:
|
---|
[554] | 945 | id:energies0_haplo
|
---|
| 946 | name:Energy of offspring from diploid forams
|
---|
| 947 | type:f 0 -1 20
|
---|
| 948 | group:Energy
|
---|
[479] | 949 |
|
---|
[486] | 950 | property:
|
---|
[554] | 951 | id:energies0_diplo
|
---|
| 952 | name:Energy of offspring from diploid forams
|
---|
| 953 | type:f 0 -1 1.25
|
---|
| 954 | group:Energy
|
---|
| 955 |
|
---|
| 956 | property:
|
---|
| 957 | id:crossprob
|
---|
| 958 | name:Crossover probability
|
---|
| 959 | type:f 0 1 0
|
---|
| 960 | group:Reproduction
|
---|
| 961 |
|
---|
| 962 | property:
|
---|
| 963 | id:mutationprob
|
---|
| 964 | name:Mutation probability
|
---|
| 965 | type:f 0 1 0
|
---|
| 966 | group:Reproduction
|
---|
| 967 |
|
---|
| 968 | property:
|
---|
| 969 | id:reproTimeSec
|
---|
| 970 | name:Time before reproduction
|
---|
| 971 | type:d 0 10000 720
|
---|
| 972 | group:Reproduction
|
---|
| 973 |
|
---|
| 974 | property:
|
---|
| 975 | id:chamberGrowthSec
|
---|
| 976 | name:Time of the chamber growth in seconds
|
---|
| 977 | type:f 360 1440 720
|
---|
[479] | 978 | group:Foraminifera
|
---|
| 979 |
|
---|
[486] | 980 | property:
|
---|
[422] | 981 | id:chamber_proculus_haplo
|
---|
[423] | 982 | name:Size of proculus
|
---|
[422] | 983 | type:f
|
---|
[421] | 984 | group:Foraminifera
|
---|
[380] | 985 |
|
---|
[486] | 986 | property:
|
---|
[422] | 987 | id:chamber_proculus_diplo
|
---|
[423] | 988 | name:Size of proculus
|
---|
[422] | 989 | type:f
|
---|
[380] | 990 | group:Foraminifera
|
---|
| 991 |
|
---|
[486] | 992 | property:
|
---|
[422] | 993 | id:chamber_difference_haplo
|
---|
[423] | 994 | name:Difference in size between subsequent chambers
|
---|
[554] | 995 | type:f 0 -1 0
|
---|
[380] | 996 | group:Foraminifera
|
---|
| 997 |
|
---|
[486] | 998 | property:
|
---|
[422] | 999 | id:chamber_difference_diplo
|
---|
[423] | 1000 | name:Difference in size between subsequent chambers
|
---|
[554] | 1001 | type:f 0 -1 0.08
|
---|
[380] | 1002 | group:Foraminifera
|
---|
| 1003 |
|
---|
[486] | 1004 | property:
|
---|
[422] | 1005 | id:hunted_prob
|
---|
| 1006 | name:Probability of being hunted
|
---|
| 1007 | type:f 0 1 0
|
---|
[554] | 1008 | group:Foraminifera
|
---|
[380] | 1009 |
|
---|
[486] | 1010 | property:
|
---|
[557] | 1011 | id:zone1_range
|
---|
[556] | 1012 | name:Zone 1 range in frams units
|
---|
[554] | 1013 | type:f 0 200 10
|
---|
[422] | 1014 | group:Foraminifera
|
---|
[380] | 1015 |
|
---|
[486] | 1016 | property:
|
---|
[422] | 1017 | id:zone2_range
|
---|
[556] | 1018 | name:Zone 2 range in frams units
|
---|
[554] | 1019 | type:f 0 3000 30
|
---|
[421] | 1020 | group:Foraminifera
|
---|
[380] | 1021 |
|
---|
[486] | 1022 | property:
|
---|
[554] | 1023 | id:chamberCostPerSec
|
---|
| 1024 | name:Cost of growning chamber per second
|
---|
| 1025 | type:f 0 1 0.000001
|
---|
| 1026 | group:Energy
|
---|
[380] | 1027 |
|
---|
[486] | 1028 | property:
|
---|
[475] | 1029 | id:e_death_level_haplo
|
---|
| 1030 | name:Minimal level of energy to sustain life of haploid
|
---|
[554] | 1031 | type:f 0 1 0.5
|
---|
| 1032 | group:Energy
|
---|
[475] | 1033 |
|
---|
[486] | 1034 | property:
|
---|
[475] | 1035 | id:e_death_level_diplo
|
---|
| 1036 | name:Minimal level of energy to sustain life of diploid
|
---|
[554] | 1037 | type:f 0 1 0.5
|
---|
| 1038 | group:Energy
|
---|
[475] | 1039 |
|
---|
[486] | 1040 | property:
|
---|
[422] | 1041 | id:energy_hib
|
---|
| 1042 | name:Energy used for hibernation during one step
|
---|
[554] | 1043 | type:f 0 1 0.0000001
|
---|
| 1044 | group:Energy
|
---|
[422] | 1045 |
|
---|
[486] | 1046 | property:
|
---|
[422] | 1047 | id:energy_move
|
---|
| 1048 | name:Energy used for movement during one step
|
---|
[554] | 1049 | type:f 0 1 0.0000005
|
---|
| 1050 | group:Energy
|
---|
[422] | 1051 |
|
---|
[486] | 1052 | property:
|
---|
[380] | 1053 | id:e_meta
|
---|
| 1054 | name:Idle metabolism
|
---|
[554] | 1055 | type:f 0 1 0.0000005
|
---|
[380] | 1056 | group:Energy
|
---|
[556] | 1057 | help:Foraminifera consumes this proportion of its energy in one time step
|
---|
[380] | 1058 |
|
---|
[486] | 1059 | property:
|
---|
[554] | 1060 | id:ingestion
|
---|
| 1061 | name:Ingestion rate
|
---|
| 1062 | type:f 0 -1 0.25
|
---|
| 1063 | group:Energy
|
---|
| 1064 |
|
---|
| 1065 | property:
|
---|
[493] | 1066 | id:nutrient_pop
|
---|
[554] | 1067 | name:Nutrient population
|
---|
[474] | 1068 | type:f 0 1000000
|
---|
[380] | 1069 | group:Energy
|
---|
| 1070 | help:How fast energy is created in the world
|
---|
| 1071 |
|
---|
[486] | 1072 | property:
|
---|
[554] | 1073 | id:energy_nut
|
---|
| 1074 | name:Nutrient energy
|
---|
| 1075 | type:f 0 10000000
|
---|
[481] | 1076 | group:Energy
|
---|
| 1077 |
|
---|
[486] | 1078 | property:
|
---|
[554] | 1079 | id:nutrientradius
|
---|
| 1080 | name:Nutrient size
|
---|
| 1081 | type:f 0.001 0.9 0.1
|
---|
[479] | 1082 | group:Energy
|
---|
| 1083 |
|
---|
[486] | 1084 | property:
|
---|
[554] | 1085 | id:picoCarbonPerMikro
|
---|
[556] | 1086 | name:Picograms of carbon in cubic micrometer
|
---|
[554] | 1087 | type:f 0 -1 0.13
|
---|
[380] | 1088 | group:Energy
|
---|
| 1089 |
|
---|
[486] | 1090 | property:
|
---|
[380] | 1091 | id:feedtrans
|
---|
[479] | 1092 | name:Energy transfer per second
|
---|
[554] | 1093 | type:f 0 1 0.001
|
---|
[380] | 1094 | group:Energy
|
---|
[422] | 1095 |
|
---|
[486] | 1096 | property:
|
---|
[479] | 1097 | id:foodperiod
|
---|
| 1098 | name:Time between food occurrences
|
---|
[554] | 1099 | type:f 0 1000000 14400
|
---|
[422] | 1100 | group:Energy
|
---|
| 1101 |
|
---|
[486] | 1102 | property:
|
---|
[554] | 1103 | id:foodPeriodChange
|
---|
| 1104 | name:Set variable feed rate
|
---|
| 1105 | type:f 0 -1 0
|
---|
[421] | 1106 | group:Energy
|
---|
| 1107 |
|
---|
[486] | 1108 | property:
|
---|
[422] | 1109 | id:stress
|
---|
| 1110 | name:Environmental stress
|
---|
| 1111 | type:d 0 1 1
|
---|
[554] | 1112 | group:
|
---|
[422] | 1113 |
|
---|
[486] | 1114 | property:
|
---|
[422] | 1115 | id:repro_trigger
|
---|
| 1116 | name:Reproduction trigger
|
---|
| 1117 | type:d 0 1 1
|
---|
[554] | 1118 | group:Reproduction
|
---|
[422] | 1119 |
|
---|
[486] | 1120 | property:
|
---|
[422] | 1121 | id:creath
|
---|
| 1122 | name:Creation height
|
---|
[554] | 1123 | type:f -1 50 -0.99
|
---|
[422] | 1124 | help:~
|
---|
| 1125 | Vertical position (above the surface) where new Forams are revived.
|
---|
| 1126 | Negative values are only used in the water area:
|
---|
| 1127 | 0 = at the surface
|
---|
| 1128 | -0.5 = half depth
|
---|
| 1129 | -1 = just above the bottom~
|
---|
| 1130 |
|
---|
[554] | 1131 | property:
|
---|
| 1132 | id:autorestart
|
---|
| 1133 | name:Restart after extinction
|
---|
| 1134 | help:Restart automatically this experiment after the last creature has died?
|
---|
| 1135 | type:d 0 1 0
|
---|
| 1136 |
|
---|
[421] | 1137 | state:
|
---|
| 1138 | id:nutrient
|
---|
[428] | 1139 | name:Nutrient locations
|
---|
[421] | 1140 | help:vector of vectors [x,y,energy]
|
---|
| 1141 | type:x
|
---|
| 1142 | flags:32
|
---|
| 1143 |
|
---|
[380] | 1144 | state:
|
---|
| 1145 | id:notes
|
---|
| 1146 | name:Notes
|
---|
| 1147 | type:s 1
|
---|
| 1148 | help:~
|
---|
| 1149 | You can write anything here
|
---|
| 1150 | (it will be saved to the experiment file)~
|
---|
| 1151 |
|
---|
| 1152 | state:
|
---|
| 1153 | id:totaltestedcr
|
---|
[421] | 1154 | name:Evaluated Forams
|
---|
| 1155 | help:Total number of the Forams evaluated in the experiment
|
---|
[380] | 1156 | type:d
|
---|
| 1157 | flags:16
|
---|