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