Changeset 486 for experiments/frams/foraminifera
- Timestamp:
- 03/26/16 02:42:55 (9 years ago)
- Location:
- experiments/frams/foraminifera/data/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/foraminifera/data/scripts/foraminifera.expdef
r481 r486 79 79 World.wrldsiz = micronsToFrams(40000); 80 80 World.wrldbnd = 1; 81 ExpP arams.stress = 1;82 ExpP arams.creath = -0.99; //just above the bottom83 ExpP arams.autorestart = 0;81 ExpProperties.stress = 1; 82 ExpProperties.creath = -0.99; //just above the bottom 83 ExpProperties.autorestart = 0; 84 84 85 85 //time 86 ExpP arams.secPerStep = 480;87 ExpP arams.foramSpeedMmPerMin = 0.05;86 ExpProperties.secPerStep = 480; 87 ExpProperties.foramSpeedMmPerMin = 0.05; 88 88 movePerStep = getMovePerStep(); 89 89 90 //ExpP arams.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions91 92 //ExpP arams.logging = 1; //uncomment to enable logging simulation parameters to log files90 //ExpProperties.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions 91 92 //ExpProperties.logging = 1; //uncomment to enable logging simulation parameters to log files 93 93 94 94 //reproduction 95 ExpP arams.foramPop = 20;96 ExpP arams.crossprob = 0;97 ExpP arams.mutationprob = 0;98 ExpP arams.repro_time = 720;99 ExpP arams.gametoPeriod = 43200;100 ExpP arams.divisionCost = 15.6;95 ExpProperties.foramPop = 20; 96 ExpProperties.crossprob = 0; 97 ExpProperties.mutationprob = 0; 98 ExpProperties.repro_time = 720; 99 ExpProperties.gametoPeriod = 43200; 100 ExpProperties.divisionCost = 15.6; 101 101 reprocounter = 0; 102 102 … … 105 105 //morphology 106 106 dir_change = 30000; 107 ExpP arams.zone1_range = micronsToFrams(1000);108 ExpP arams.zone2_range = micronsToFrams(3000);109 ExpP arams.chamber_growth_time = 720;110 ExpP arams.chamberCostPerSec = 0.000001;111 ExpP arams.chamber_proculus_haplo = micronsToFrams(50);112 ExpP arams.chamber_difference_haplo = 0.0;113 ExpP arams.chamber_proculus_diplo = micronsToFrams(20);114 ExpP arams.chamber_difference_diplo = micronsToFrams(8);107 ExpProperties.zone1_range = micronsToFrams(1000); 108 ExpProperties.zone2_range = micronsToFrams(3000); 109 ExpProperties.chamber_growth_time = 720; 110 ExpProperties.chamberCostPerSec = 0.000001; 111 ExpProperties.chamber_proculus_haplo = micronsToFrams(50); 112 ExpProperties.chamber_difference_haplo = 0.0; 113 ExpProperties.chamber_proculus_diplo = micronsToFrams(20); 114 ExpProperties.chamber_difference_diplo = micronsToFrams(8); 115 115 116 116 max_chamber_volume = [Vector.new(), Vector.new()]; … … 124 124 125 125 //energetics 126 ExpP arams.min_repro_energ_haplo = 4;127 ExpP arams.min_repro_energ_diplo = 6;128 129 ExpP arams.e_meta = 0.0000005;130 ExpP arams.energy_hib = 0.0000001;131 ExpP arams.energy_move = 0.0000005;132 133 ExpP arams.energies0_haplo = energyFromVolume(micronsToFrams(20),1);134 ExpP arams.energies0_diplo = energyFromVolume(micronsToFrams(1.25),1);135 ExpP arams.feedtrans = 0.001;136 ExpP arams.e_repro_cost_haplo = 0.3;137 ExpP arams.e_repro_cost_diplo = 0.2;138 139 ExpP arams.e_death_level_haplo = 0.5;140 ExpP arams.e_death_level_diplo = 0.5;126 ExpProperties.min_repro_energ_haplo = 4; 127 ExpProperties.min_repro_energ_diplo = 6; 128 129 ExpProperties.e_meta = 0.0000005; 130 ExpProperties.energy_hib = 0.0000001; 131 ExpProperties.energy_move = 0.0000005; 132 133 ExpProperties.energies0_haplo = energyFromVolume(micronsToFrams(20),1); 134 ExpProperties.energies0_diplo = energyFromVolume(micronsToFrams(1.25),1); 135 ExpProperties.feedtrans = 0.001; 136 ExpProperties.e_repro_cost_haplo = 0.3; 137 ExpProperties.e_repro_cost_diplo = 0.2; 138 139 ExpProperties.e_death_level_haplo = 0.5; 140 ExpProperties.e_death_level_diplo = 0.5; 141 141 142 142 //nutrients 143 143 changePeriod = 0; 144 144 phase = "high"; 145 ExpP arams.foodperiod = 21600;146 ExpP arams.foodPeriodChange = 0;147 ExpP arams.nutrientradius = micronsToFrams(10);148 ExpP arams.energy_nut = energyFromVolume(ExpParams.nutrientradius,1);149 ExpP arams.feedrate = 1;150 ExpP arams.ingestion = 0.25;145 ExpProperties.foodperiod = 21600; 146 ExpProperties.foodPeriodChange = 0; 147 ExpProperties.nutrientradius = micronsToFrams(10); 148 ExpProperties.energy_nut = energyFromVolume(ExpProperties.nutrientradius,1); 149 ExpProperties.feedrate = 1; 150 ExpProperties.ingestion = 0.25; 151 151 nutrientenergywaiting = 0; 152 152 ExpState.totaltestedcr = 0; … … 165 165 if (isRadiusInFrams == 1) //radius in frams 166 166 { 167 return ExpP arams.picoCarbonPerMikro*volumeInMicrons(base);167 return ExpProperties.picoCarbonPerMikro*volumeInMicrons(base); 168 168 } 169 169 else //volume in microns 170 170 { 171 return ExpP arams.picoCarbonPerMikro * base;171 return ExpProperties.picoCarbonPerMikro * base; 172 172 } 173 173 } … … 175 175 function getMovePerStep() 176 176 { 177 return micronsToFrams((ExpP arams.foramSpeedMmPerMin/60)*1000)*ExpParams.secPerStep;177 return micronsToFrams((ExpProperties.foramSpeedMmPerMin/60)*1000)*ExpProperties.secPerStep; 178 178 } 179 179 … … 192 192 var ploid = "haplo"; 193 193 if (gen == 1) ploid = "diplo"; 194 return ExpP arams.[prop_id + "_" + ploid];194 return ExpProperties.[prop_id + "_" + ploid]; 195 195 } 196 196 … … 228 228 Populations[2].clear(); //reticulopodia and nutrients 229 229 230 for (var i = 0; i < ExpP arams.foramPop; i++)230 for (var i = 0; i < ExpProperties.foramPop; i++) 231 231 { 232 232 addInitialForam(0, i); … … 235 235 o = Populations[0][0].getMechPart(0).orient.clone(); 236 236 ExpState.totaltestedcr = 0; 237 nutrientenergywaiting = ExpP arams.energy_nut;237 nutrientenergywaiting = ExpProperties.energy_nut; 238 238 } 239 239 … … 306 306 { 307 307 //percent of current energy 308 cr.idleen = (ExpP arams.e_meta * cr.energy)*ExpParams.secPerStep;308 cr.idleen = (ExpProperties.e_meta * cr.energy)*ExpProperties.secPerStep; 309 309 } 310 310 … … 316 316 function getZoneRange(cr, zone_num) 317 317 { 318 return ExpP arams.["zone"+zone_num+"_range"];318 return ExpProperties.["zone"+zone_num+"_range"]; 319 319 } 320 320 … … 322 322 { 323 323 setForamMeta(cr); 324 if (ExpP arams.visualize == 1)324 if (ExpProperties.visualize == 1) 325 325 { 326 326 var ret = Populations[2].add("//0\np:sh=3,sx=0.01,sy="+getZoneRange(cr,1)+",sz="+getZoneRange(cr,1)+",ry=1.57,vr=1.0,1.0,1.0"); … … 438 438 { 439 439 //percent of maximal energy 440 cr.energy_m += (ExpP arams.energy_move * cr.data->lifeparams->max_energy_level)*ExpParams.secPerStep;440 cr.energy_m += (ExpProperties.energy_move * cr.data->lifeparams->max_energy_level)*ExpProperties.secPerStep; 441 441 } 442 442 } … … 469 469 } 470 470 //random move 471 else if (cr.lifespan%int(dir_change/ExpP arams.secPerStep) == 0)471 else if (cr.lifespan%int(dir_change/ExpProperties.secPerStep) == 0) 472 472 { 473 473 cr.data->lifeparams->dir = randomDir(); … … 483 483 function randomDir() 484 484 { 485 var dir = (Math.rndUni(-ExpP arams.zone2_range, ExpParams.zone2_range), Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), 0);485 var dir = (Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), 0); 486 486 dir.normalize(); 487 487 dir.scale(-1*movePerStep); … … 492 492 { 493 493 cr1.localDrive = XYZ.new(0,0,0); 494 var e = ExpP arams.feedtrans*cr1.energy;//ExpParams.feedtrans*cr1.energy*ExpParams.ingestion*ExpParams.secPerStep; //TODO efficiency dependent on age494 var e = ExpProperties.feedtrans*cr1.energy;//ExpProperties.feedtrans*cr1.energy*ExpProperties.ingestion*ExpProperties.secPerStep; //TODO efficiency dependent on age 495 495 e = Math.min(cr2.energy, e); 496 e *= ExpP arams.secPerStep;497 //Simulator.print("transferring "+e +"("+e*ExpP arams.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.name+" ("+cr2.energy+") "+ e/ExpParams.secPerStep+ " per sec");496 e *= ExpProperties.secPerStep; 497 //Simulator.print("transferring "+e +"("+e*ExpProperties.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.name+" ("+cr2.energy+") "+ e/ExpProperties.secPerStep+ " per sec"); 498 498 cr2.energy_m = cr2.energy_m + e + 0.0000001; 499 cr1.energy_p = cr1.energy_p + e*ExpP arams.ingestion;499 cr1.energy_p = cr1.energy_p + e*ExpProperties.ingestion; 500 500 if (cr1.data->lifeparams->hibernated == 1) 501 501 { … … 512 512 else 513 513 { 514 cr.idleen = (ExpP arams.energy_hib * cr.energy)*ExpParams.secPerStep; //hibernate514 cr.idleen = (ExpProperties.energy_hib * cr.energy)*ExpProperties.secPerStep; //hibernate 515 515 } 516 516 cr.data->lifeparams->hibernated = 1 - cr.data->lifeparams->hibernated; … … 534 534 { 535 535 cr.data->lifeparams->chamber_growth = Math.max(cr.data->lifeparams->chamber_growth-1,0); 536 //Simulator.print("chamber growing, time left = " + cr.data->lifeparams->chamber_growth*ExpP arams.secPerStep);537 cr.energy_m += ExpP arams.chamberCostPerSec * cr.energy * ExpParams.secPerStep;536 //Simulator.print("chamber growing, time left = " + cr.data->lifeparams->chamber_growth*ExpProperties.secPerStep); 537 cr.energy_m += ExpProperties.chamberCostPerSec * cr.energy * ExpProperties.secPerStep; 538 538 539 539 //Simulator.print("energy " + cr2.energy + " subtracting " + growth_cost); … … 581 581 if ((cr.data->lifeparams->max_energy_level >= energyFromVolume(max_chamber_volume[cr.data->lifeparams->gen][lastChamberNum(cr)],0))) 582 582 { 583 cr.data->lifeparams->chamber_growth = int(ExpP arams.chamber_growth_time/ExpParams.secPerStep);583 cr.data->lifeparams->chamber_growth = int(ExpProperties.chamber_growth_time/ExpProperties.secPerStep); 584 584 } 585 585 } … … 589 589 function deathConditions(cr) 590 590 { 591 if ((cr.energy <= getProperty(cr.data->lifeparams->gen,"e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpP arams.hunted_prob))591 if ((cr.energy <= getProperty(cr.data->lifeparams->gen,"e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpProperties.hunted_prob)) 592 592 { 593 593 return 1; … … 607 607 geno.data->genes = cr.data->genes; 608 608 geno.data->lifeparams = cr.data->lifeparams; 609 if (ExpP arams.logging == 1) Simulator.print("\"" + cr.name + "\" died...");609 if (ExpProperties.logging == 1) Simulator.print("\"" + cr.name + "\" died..."); 610 610 ExpState.totaltestedcr++; 611 611 } … … 627 627 function addNutrient() 628 628 { 629 var cr = Populations[1].add(createNutrientGenotype(ExpP arams.nutrientradius));629 var cr = Populations[1].add(createNutrientGenotype(ExpProperties.nutrientradius)); 630 630 631 631 cr.name = "Nutrients"; 632 632 cr.idleen = 0; 633 cr.energy0 = ExpP arams.energy_nut;633 cr.energy0 = ExpProperties.energy_nut; 634 634 cr.energy = cr.energy0; 635 635 cr.signals.add("nutrient"); … … 638 638 639 639 placeCreatureRandomly(cr, 0, 0); 640 if (ExpP arams.visualize == 1)641 { 642 var nutsize = ExpP arams.nutrientradius*10;640 if (ExpProperties.visualize == 1) 641 { 642 var nutsize = ExpProperties.nutrientradius*10; 643 643 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"); 644 644 cr.data->reticulopodiacreature = nut; … … 657 657 function nutrientGrowth() 658 658 { 659 if (ExpP arams.foodPeriodChange > 0)659 if (ExpProperties.foodPeriodChange > 0) 660 660 { 661 661 changePeriod += 1; 662 if (phase=="low" && (changePeriod*ExpP arams.secPerStep) >= 23328000) //9 months662 if (phase=="low" && (changePeriod*ExpProperties.secPerStep) >= 23328000) //9 months 663 663 { 664 ExpP arams.foodperiod = ExpParams.foodperiod/ExpParams.foodPeriodChange;664 ExpProperties.foodperiod = ExpProperties.foodperiod/ExpProperties.foodPeriodChange; 665 665 phase = "high"; 666 666 changePeriod = 0; 667 667 } 668 668 669 else if (phase == "high" && (changePeriod*ExpP arams.secPerStep) >= 7776000) //3 months669 else if (phase == "high" && (changePeriod*ExpProperties.secPerStep) >= 7776000) //3 months 670 670 { 671 ExpP arams.foodperiod = ExpParams.foodperiod*ExpParams.foodPeriodChange;671 ExpProperties.foodperiod = ExpProperties.foodperiod*ExpProperties.foodPeriodChange; 672 672 phase = "low"; 673 673 changePeriod = 0; … … 675 675 } 676 676 nutrientenergywaiting = nutrientenergywaiting + 1; 677 if (nutrientenergywaiting*ExpP arams.secPerStep >= ExpParams.foodperiod)678 { 679 for (var i = 0; i < ExpP arams.feedrate; i++)677 if (nutrientenergywaiting*ExpProperties.secPerStep >= ExpProperties.foodperiod) 678 { 679 for (var i = 0; i < ExpProperties.feedrate; i++) 680 680 { 681 681 addNutrient(); … … 695 695 696 696 nutrientGrowth(); 697 if (ExpP arams.logging == 1)697 if (ExpProperties.logging == 1) 698 698 { 699 699 createStatistics(); … … 702 702 //reproduction -------------------------------------------- 703 703 reprocounter += 1; 704 if (reprocounter*ExpP arams.secPerStep > ExpParams.repro_time)704 if (reprocounter*ExpProperties.secPerStep > ExpProperties.repro_time) 705 705 { 706 706 reprocounter = 0; … … 712 712 if (Populations[0].size == 0) 713 713 { 714 if (ExpP arams.autorestart)714 if (ExpProperties.autorestart) 715 715 { 716 716 Simulator.print("no more creatures, restarting..."); … … 723 723 } 724 724 } 725 if (ExpP arams.maxSteps > 0)726 { 727 if (Simulator.stepNumber >= ExpP arams.maxSteps)725 if (ExpProperties.maxSteps > 0) 726 { 727 if (Simulator.stepNumber >= ExpProperties.maxSteps) 728 728 Simulator.stop(); 729 729 } … … 778 778 ~ 779 779 780 prop :780 property: 781 781 id:visualize 782 782 name:Show reticulopodia and nutrients … … 784 784 group:Foraminifera 785 785 786 prop :786 property: 787 787 id:maxSteps 788 788 name:Stop after the given number of simulation steps 789 789 type:d 0 1000000 0 790 790 791 prop :791 property: 792 792 id:foramSpeedMmPerMin 793 793 name:Speed of foraminfera in mm/min … … 796 796 group:Foraminifera 797 797 798 prop :798 property: 799 799 id:gametSuccessRate 800 800 name:Ratio of successful gamets … … 802 802 group:Foraminifera 803 803 804 prop :804 property: 805 805 id:gametoPeriod 806 806 name:Time of gametogenesis … … 808 808 group:Foraminifera 809 809 810 prop :810 property: 811 811 id:picoCarbonPerMikro 812 812 name:Picograms of carbon in cubed micrometer … … 814 814 group:Foraminifera 815 815 816 prop :816 property: 817 817 id:secPerStep 818 818 name:Seconds per simulation step … … 821 821 group:Foraminifera 822 822 823 prop :823 property: 824 824 id:e_repro_cost_haplo 825 825 name:Cost of reproduction … … 827 827 group:Foraminifera 828 828 829 prop :829 property: 830 830 id:divisionCost 831 831 name:Cost of division in pG … … 833 833 group:Foraminifera 834 834 835 prop :835 property: 836 836 id:e_repro_cost_diplo 837 837 name:Cost of reproduction … … 839 839 group:Foraminifera 840 840 841 prop :841 property: 842 842 id:chamber_growth_time 843 843 name:Time of the chamber growth in seconds … … 845 845 group:Foraminifera 846 846 847 prop :847 property: 848 848 id:chamberCostPerSec 849 849 name:Cost of growning chamber per second … … 851 851 group:Foraminifera 852 852 853 prop :853 property: 854 854 id:chamber_proculus_haplo 855 855 name:Size of proculus … … 857 857 group:Foraminifera 858 858 859 prop :859 property: 860 860 id:chamber_proculus_diplo 861 861 name:Size of proculus … … 863 863 group:Foraminifera 864 864 865 prop :865 property: 866 866 id:chamber_difference_haplo 867 867 name:Difference in size between subsequent chambers … … 869 869 group:Foraminifera 870 870 871 prop :871 property: 872 872 id:chamber_difference_diplo 873 873 name:Difference in size between subsequent chambers … … 875 875 group:Foraminifera 876 876 877 prop :877 property: 878 878 id:hunted_prob 879 879 name:Probability of being hunted … … 881 881 group:Forminifera 882 882 883 prop :883 property: 884 884 id:zone1_range 885 885 name:Zone 1 range … … 887 887 group:Foraminifera 888 888 889 prop :889 property: 890 890 id:zone2_range 891 891 name:Zone 2 range … … 893 893 group:Foraminifera 894 894 895 prop :895 property: 896 896 id:colors 897 897 name:Haploid and diploid colors … … 899 899 group:Foraminifera 900 900 901 prop :901 property: 902 902 id:min_repro_energ_haplo 903 903 name:Min reproduction energy of forams … … 905 905 group:Foraminifera 906 906 907 prop :907 property: 908 908 id:min_repro_energ_diplo 909 909 name:Min reproduction energy of forams … … 911 911 group:Foraminifera 912 912 913 prop :913 property: 914 914 id:repro_prob 915 915 name:Probability of reproduction … … 917 917 group:Foraminifera 918 918 919 prop :919 property: 920 920 id:energies0_haplo 921 921 name:Energy of offspring from diploid forams … … 923 923 group:Foraminifera 924 924 925 prop :925 property: 926 926 id:energies0_diplo 927 927 name:Energy of offspring from diploid forams … … 929 929 group:Foraminifera 930 930 931 prop :931 property: 932 932 id:e_death_level_haplo 933 933 name:Minimal level of energy to sustain life of haploid … … 935 935 group:Foraminifera 936 936 937 prop :937 property: 938 938 id:e_death_level_diplo 939 939 name:Minimal level of energy to sustain life of diploid … … 941 941 group:Foraminifera 942 942 943 prop :943 property: 944 944 id:energy_hib 945 945 name:Energy used for hibernation during one step … … 947 947 group:Foraminifera 948 948 949 prop :949 property: 950 950 id:energy_move 951 951 name:Energy used for movement during one step … … 953 953 group:Foraminifera 954 954 955 prop :955 property: 956 956 id:min_vol 957 957 name:Minimal volume for reproduction … … 959 959 group:Foraminifera 960 960 961 prop :961 property: 962 962 id:max_size 963 963 name:Maximal size … … 965 965 group:Foraminifera 966 966 967 prop :967 property: 968 968 id:foramPop 969 969 name:Initial forams population size … … 971 971 group:Foraminifera 972 972 973 prop :973 property: 974 974 id:crossprob 975 975 name:Crossover probability … … 977 977 group:Foraminifera 978 978 979 prop :979 property: 980 980 id:mutationprob 981 981 name:Mutation probability … … 983 983 group:Foraminifera 984 984 985 prop :985 property: 986 986 id:e_meta 987 987 name:Idle metabolism … … 990 990 help:Each stick consumes this amount of energy in one time step 991 991 992 prop :992 property: 993 993 id:feedrate 994 994 name:Feeding rate … … 997 997 help:How fast energy is created in the world 998 998 999 prop :999 property: 1000 1000 id:foodPeriodChange 1001 1001 name:Set variable feed rate … … 1003 1003 group:Energy 1004 1004 1005 prop :1005 property: 1006 1006 id:ingestion 1007 1007 name:Ingestion rate … … 1009 1009 group:Energy 1010 1010 1011 prop :1011 property: 1012 1012 id:energy_nut 1013 1013 name:Nutrient energy … … 1015 1015 group:Energy 1016 1016 1017 prop :1017 property: 1018 1018 id:feedtrans 1019 1019 name:Energy transfer per second … … 1021 1021 group:Energy 1022 1022 1023 prop :1023 property: 1024 1024 id:foodperiod 1025 1025 name:Time between food occurrences … … 1027 1027 group:Energy 1028 1028 1029 prop :1029 property: 1030 1030 id:nutrientradius 1031 1031 name:Nutrient size … … 1033 1033 group:Energy 1034 1034 1035 prop :1035 property: 1036 1036 id:stress 1037 1037 name:Environmental stress … … 1039 1039 group:World 1040 1040 1041 prop :1041 property: 1042 1042 id:repro_trigger 1043 1043 name:Reproduction trigger … … 1045 1045 group:World 1046 1046 1047 prop :1047 property: 1048 1048 id:repro_time 1049 1049 name:Time before reproduction 1050 1050 type:d 0 10000 1051 1051 1052 prop :1052 property: 1053 1053 id:creath 1054 1054 name:Creation height … … 1068 1068 flags:32 1069 1069 1070 prop :1070 property: 1071 1071 id:autorestart 1072 1072 name:Restart after extinction … … 1089 1089 flags:16 1090 1090 1091 prop :1091 property: 1092 1092 id:logging 1093 1093 name:Log statistics to file -
experiments/frams/foraminifera/data/scripts/foraminifera.inc
r479 r486 74 74 var number = 1; 75 75 var result = parent_energy; 76 while ((result-ExpP arams.divisionCost) >= energy0)77 { 78 result = (result-ExpP arams.divisionCost)/2;76 while ((result-ExpProperties.divisionCost) >= energy0) 77 { 78 result = (result-ExpProperties.divisionCost)/2; 79 79 number *= 2; 80 80 } … … 100 100 var offspring2 = gametsDivision(parent2.energy,getProperty(1,"energies0")); 101 101 energy0 = (offspring1->energy+offspring2->energy); 102 number = ExpP arams.gametSuccessRate*(offspring1->number+offspring2->number)/2;102 number = ExpProperties.gametSuccessRate*(offspring1->number+offspring2->number)/2; 103 103 new_genes = [parent.data->genes, parent2.data->genes]; 104 104 gen = 1 - parent.data->lifeparams->gen; … … 124 124 var crossed = 0; 125 125 //crossover 126 if (Math.rnd01 < ExpP arams.crossprob)126 if (Math.rnd01 < ExpProperties.crossprob) 127 127 { 128 128 crossover(parent, "min_repro_energies"); … … 154 154 if (pop[i].data->lifeparams->reproduce == 1 && pop[i].data->lifeparams->species == species) 155 155 { 156 if ((pop[i].data->lifeparams->gen==1) || ((pop[i].data->lifeparams->gen==0) && ExpP arams.stress == 0))156 if ((pop[i].data->lifeparams->gen==1) || ((pop[i].data->lifeparams->gen==0) && ExpProperties.stress == 0)) 157 157 { 158 158 continue; … … 171 171 if (parent1.data->lifeparams->division_time == -1 && parent2.data->lifeparams->division_time == -1) 172 172 { 173 var time = int(ExpP arams.gametoPeriod/ExpParams.secPerStep);173 var time = int(ExpProperties.gametoPeriod/ExpProperties.secPerStep); 174 174 parent1.data->lifeparams->division_time = time; 175 175 parent2.data->lifeparams->division_time = time; … … 206 206 } 207 207 208 else if (ExpP arams.stress == 0)208 else if (ExpProperties.stress == 0) 209 209 { 210 210 reproduce_haploid(cr, null, 1); … … 256 256 { 257 257 //reproduce with probability repro_prob 258 if (Math.rnd01 <= ExpP arams.repro_prob) //TODO env trigger258 if (Math.rnd01 <= ExpProperties.repro_prob) //TODO env trigger 259 259 { 260 260 reproduced = readyToRepro(cr); -
experiments/frams/foraminifera/data/scripts/foraminifera.show
r474 r486 24 24 TrackingCam.cam_h = 15; //more side view 25 25 Params = { "feedrate" : [200,100,50], "feedtrans" : [0.05,0.125,0.25],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1], "visualize" : [0,1]}; 26 ShowP arams.visualize=1;26 ShowProperties.visualize=1; 27 27 } 28 28 … … 31 31 //just a draft, this function and all constants in expdef need serious review 32 32 var localDriveMicronsPerStep=framsToMicrons(getMovePerStep()); 33 var foramSpeedMmPerSec=ExpP arams.foramSpeedMmPerMin/60;33 var foramSpeedMmPerSec=ExpProperties.foramSpeedMmPerMin/60; 34 34 var localDriveMmPerStep=localDriveMicronsPerStep/1000; 35 35 var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed; … … 54 54 function setShowParam(param_id) 55 55 { 56 ExpP arams.[param_id] = Params[param_id][ShowParams.[param_id]];56 ExpProperties.[param_id] = Params[param_id][ShowProperties.[param_id]]; 57 57 } 58 58 59 function ShowP arams_feedrate_set()59 function ShowProperties_feedrate_set() 60 60 { 61 61 setShowParam("feedrate"); 62 62 } 63 63 64 function ShowP arams_feedtrans_set()64 function ShowProperties_feedtrans_set() 65 65 { 66 66 setShowParam("feedtrans"); 67 67 } 68 68 69 function ShowP arams_energy_nut_set()69 function ShowProperties_energy_nut_set() 70 70 { 71 71 setShowParam("energy_nut"); 72 72 } 73 73 74 function ShowP arams_stress_set()74 function ShowProperties_stress_set() 75 75 { 76 76 setShowParam("stress"); 77 77 } 78 78 79 function ShowP arams_visualize_set()79 function ShowProperties_visualize_set() 80 80 { 81 81 setShowParam("visualize"); … … 84 84 ~ 85 85 86 prop :86 property: 87 87 id:feedrate 88 88 name:Feeding rate 89 89 type:d 0 2 1 ~Low~Medium~High 90 90 91 prop :91 property: 92 92 id:feedtrans 93 93 name:Energy transfer 94 94 type:d 0 2 1 ~0.05~0.125~0.25 95 95 96 prop :96 property: 97 97 id:energy_nut 98 98 name:Nutrient energy 99 99 type:d 0 2 1 ~0.5~1.5~3 100 100 101 prop :101 property: 102 102 id:stress 103 103 name:Stress 104 104 type:d 0 1 1 105 105 106 prop :106 property: 107 107 id:visualize 108 108 name:Enhance visualization
Note: See TracChangeset
for help on using the changeset viewer.