Ignore:
Timestamp:
03/26/16 02:42:55 (9 years ago)
Author:
sz
Message:

foraminifera scripts updated to match the upcoming Framsticks version (ExpParams? ==> ExpProperties?, Fields ==> NeuroProperties?, prop: ==> property:)

Location:
experiments/frams/foraminifera/data/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • experiments/frams/foraminifera/data/scripts/foraminifera.expdef

    r481 r486  
    7979        World.wrldsiz = micronsToFrams(40000);
    8080        World.wrldbnd = 1;
    81         ExpParams.stress = 1;
    82         ExpParams.creath = -0.99; //just above the bottom
    83         ExpParams.autorestart = 0;
     81        ExpProperties.stress = 1;
     82        ExpProperties.creath = -0.99; //just above the bottom
     83        ExpProperties.autorestart = 0;
    8484
    8585        //time
    86         ExpParams.secPerStep = 480;
    87         ExpParams.foramSpeedMmPerMin = 0.05;
     86        ExpProperties.secPerStep = 480;
     87        ExpProperties.foramSpeedMmPerMin = 0.05;
    8888        movePerStep = getMovePerStep();
    8989
    90         //ExpParams.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions
    91 
    92         //ExpParams.logging = 1; //uncomment to enable logging simulation parameters to log files
     90        //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
    9393
    9494        //reproduction
    95         ExpParams.foramPop = 20;       
    96         ExpParams.crossprob = 0;
    97         ExpParams.mutationprob = 0;
    98         ExpParams.repro_time = 720;
    99         ExpParams.gametoPeriod = 43200;
    100         ExpParams.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;
    101101        reprocounter = 0;
    102102
     
    105105        //morphology
    106106        dir_change = 30000;
    107         ExpParams.zone1_range = micronsToFrams(1000);
    108         ExpParams.zone2_range = micronsToFrams(3000);
    109         ExpParams.chamber_growth_time = 720;
    110         ExpParams.chamberCostPerSec = 0.000001;
    111         ExpParams.chamber_proculus_haplo = micronsToFrams(50);
    112         ExpParams.chamber_difference_haplo = 0.0;
    113         ExpParams.chamber_proculus_diplo = micronsToFrams(20);
    114         ExpParams.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);
    115115
    116116        max_chamber_volume = [Vector.new(), Vector.new()];
     
    124124
    125125        //energetics
    126         ExpParams.min_repro_energ_haplo = 4;
    127         ExpParams.min_repro_energ_diplo = 6;
    128 
    129         ExpParams.e_meta = 0.0000005;
    130         ExpParams.energy_hib = 0.0000001;
    131         ExpParams.energy_move = 0.0000005;
    132 
    133         ExpParams.energies0_haplo = energyFromVolume(micronsToFrams(20),1);
    134         ExpParams.energies0_diplo = energyFromVolume(micronsToFrams(1.25),1);
    135         ExpParams.feedtrans = 0.001;
    136         ExpParams.e_repro_cost_haplo = 0.3;
    137         ExpParams.e_repro_cost_diplo = 0.2;
    138 
    139         ExpParams.e_death_level_haplo = 0.5;
    140         ExpParams.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;
    141141
    142142        //nutrients
    143143        changePeriod = 0;
    144144        phase = "high";
    145         ExpParams.foodperiod = 21600;
    146         ExpParams.foodPeriodChange = 0;
    147         ExpParams.nutrientradius = micronsToFrams(10);
    148         ExpParams.energy_nut = energyFromVolume(ExpParams.nutrientradius,1);
    149         ExpParams.feedrate = 1;
    150         ExpParams.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;
    151151        nutrientenergywaiting = 0;
    152152        ExpState.totaltestedcr = 0;
     
    165165        if (isRadiusInFrams == 1) //radius in frams
    166166        {
    167                 return ExpParams.picoCarbonPerMikro*volumeInMicrons(base);
     167                return ExpProperties.picoCarbonPerMikro*volumeInMicrons(base);
    168168        }
    169169        else //volume in microns
    170170        {
    171                 return ExpParams.picoCarbonPerMikro * base;
     171                return ExpProperties.picoCarbonPerMikro * base;
    172172        }
    173173}
     
    175175function getMovePerStep()
    176176{
    177         return micronsToFrams((ExpParams.foramSpeedMmPerMin/60)*1000)*ExpParams.secPerStep;
     177        return micronsToFrams((ExpProperties.foramSpeedMmPerMin/60)*1000)*ExpProperties.secPerStep;
    178178}
    179179
     
    192192        var ploid = "haplo";
    193193        if (gen == 1) ploid = "diplo";
    194         return ExpParams.[prop_id + "_" + ploid];
     194        return ExpProperties.[prop_id + "_" + ploid];
    195195}
    196196
     
    228228        Populations[2].clear(); //reticulopodia and nutrients
    229229
    230         for (var i = 0; i < ExpParams.foramPop; i++)
     230        for (var i = 0; i < ExpProperties.foramPop; i++)
    231231        {
    232232                addInitialForam(0, i); 
     
    235235        o = Populations[0][0].getMechPart(0).orient.clone();
    236236        ExpState.totaltestedcr = 0;
    237         nutrientenergywaiting = ExpParams.energy_nut;
     237        nutrientenergywaiting = ExpProperties.energy_nut;
    238238}
    239239
     
    306306{
    307307        //percent of current energy
    308         cr.idleen = (ExpParams.e_meta * cr.energy)*ExpParams.secPerStep;
     308        cr.idleen = (ExpProperties.e_meta * cr.energy)*ExpProperties.secPerStep;
    309309}
    310310
     
    316316function getZoneRange(cr, zone_num)
    317317{
    318         return ExpParams.["zone"+zone_num+"_range"];
     318        return ExpProperties.["zone"+zone_num+"_range"];
    319319}
    320320
     
    322322{
    323323        setForamMeta(cr);
    324         if (ExpParams.visualize == 1)
     324        if (ExpProperties.visualize == 1)
    325325        {
    326326                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");
     
    438438        {
    439439                //percent of maximal energy
    440                 cr.energy_m += (ExpParams.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;
    441441        }
    442442}
     
    469469        }
    470470        //random move
    471         else if (cr.lifespan%int(dir_change/ExpParams.secPerStep) == 0)
     471        else if (cr.lifespan%int(dir_change/ExpProperties.secPerStep) == 0)
    472472        {
    473473                cr.data->lifeparams->dir = randomDir();
     
    483483function randomDir()
    484484{
    485         var dir = (Math.rndUni(-ExpParams.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); 
    486486        dir.normalize();
    487487        dir.scale(-1*movePerStep);
     
    492492{
    493493        cr1.localDrive = XYZ.new(0,0,0);
    494         var e =  ExpParams.feedtrans*cr1.energy;//ExpParams.feedtrans*cr1.energy*ExpParams.ingestion*ExpParams.secPerStep; //TODO efficiency dependent on age
     494        var e =  ExpProperties.feedtrans*cr1.energy;//ExpProperties.feedtrans*cr1.energy*ExpProperties.ingestion*ExpProperties.secPerStep; //TODO efficiency dependent on age
    495495        e = Math.min(cr2.energy, e);
    496         e *= ExpParams.secPerStep;
    497         //Simulator.print("transferring "+e +"("+e*ExpParams.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");
    498498        cr2.energy_m = cr2.energy_m + e + 0.0000001;
    499         cr1.energy_p = cr1.energy_p + e*ExpParams.ingestion;
     499        cr1.energy_p = cr1.energy_p + e*ExpProperties.ingestion;
    500500        if (cr1.data->lifeparams->hibernated == 1)
    501501        {
     
    512512        else
    513513        {
    514                 cr.idleen = (ExpParams.energy_hib * cr.energy)*ExpParams.secPerStep; //hibernate
     514                cr.idleen = (ExpProperties.energy_hib * cr.energy)*ExpProperties.secPerStep; //hibernate
    515515        }
    516516        cr.data->lifeparams->hibernated = 1 - cr.data->lifeparams->hibernated;
     
    534534        {
    535535                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*ExpParams.secPerStep);
    537                 cr.energy_m += ExpParams.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;
    538538
    539539                //Simulator.print("energy " + cr2.energy + " subtracting " + growth_cost);
     
    581581                        if ((cr.data->lifeparams->max_energy_level >= energyFromVolume(max_chamber_volume[cr.data->lifeparams->gen][lastChamberNum(cr)],0)))   
    582582                        {
    583                                 cr.data->lifeparams->chamber_growth = int(ExpParams.chamber_growth_time/ExpParams.secPerStep);
     583                                cr.data->lifeparams->chamber_growth = int(ExpProperties.chamber_growth_time/ExpProperties.secPerStep);
    584584                        }       
    585585                }
     
    589589function deathConditions(cr)
    590590{
    591         if ((cr.energy <= getProperty(cr.data->lifeparams->gen,"e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpParams.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))
    592592        {
    593593                return 1;
     
    607607        geno.data->genes = cr.data->genes;
    608608        geno.data->lifeparams = cr.data->lifeparams;
    609         if (ExpParams.logging == 1) Simulator.print("\"" + cr.name + "\" died...");
     609        if (ExpProperties.logging == 1) Simulator.print("\"" + cr.name + "\" died...");
    610610        ExpState.totaltestedcr++;
    611611}
     
    627627function addNutrient()
    628628{
    629         var cr = Populations[1].add(createNutrientGenotype(ExpParams.nutrientradius));
     629        var cr = Populations[1].add(createNutrientGenotype(ExpProperties.nutrientradius));
    630630
    631631        cr.name = "Nutrients";
    632632        cr.idleen = 0;
    633         cr.energy0 = ExpParams.energy_nut;
     633        cr.energy0 = ExpProperties.energy_nut;
    634634        cr.energy = cr.energy0;
    635635        cr.signals.add("nutrient");
     
    638638
    639639        placeCreatureRandomly(cr, 0, 0);
    640         if (ExpParams.visualize == 1)
    641         {
    642                 var nutsize = ExpParams.nutrientradius*10;
     640        if (ExpProperties.visualize == 1)
     641        {
     642                var nutsize = ExpProperties.nutrientradius*10;
    643643                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");
    644644                cr.data->reticulopodiacreature = nut;
     
    657657function nutrientGrowth()
    658658{
    659         if (ExpParams.foodPeriodChange > 0)
     659        if (ExpProperties.foodPeriodChange > 0)
    660660        {
    661661                        changePeriod += 1;
    662                         if (phase=="low" && (changePeriod*ExpParams.secPerStep) >= 23328000) //9 months
     662                        if (phase=="low" && (changePeriod*ExpProperties.secPerStep) >= 23328000) //9 months
    663663                        {
    664                                 ExpParams.foodperiod = ExpParams.foodperiod/ExpParams.foodPeriodChange;
     664                                ExpProperties.foodperiod = ExpProperties.foodperiod/ExpProperties.foodPeriodChange;
    665665                                phase = "high";
    666666                                changePeriod = 0;
    667667                        }
    668668               
    669                         else if (phase == "high" && (changePeriod*ExpParams.secPerStep) >= 7776000) //3 months
     669                        else if (phase == "high" && (changePeriod*ExpProperties.secPerStep) >= 7776000) //3 months
    670670                        {
    671                                 ExpParams.foodperiod = ExpParams.foodperiod*ExpParams.foodPeriodChange;
     671                                ExpProperties.foodperiod = ExpProperties.foodperiod*ExpProperties.foodPeriodChange;
    672672                                phase = "low";
    673673                                changePeriod = 0;
     
    675675        }
    676676        nutrientenergywaiting = nutrientenergywaiting + 1;
    677         if (nutrientenergywaiting*ExpParams.secPerStep >= ExpParams.foodperiod)
    678         {
    679                 for (var i = 0; i < ExpParams.feedrate; i++)
     677        if (nutrientenergywaiting*ExpProperties.secPerStep >= ExpProperties.foodperiod)
     678        {
     679                for (var i = 0; i < ExpProperties.feedrate; i++)
    680680                {   
    681681                        addNutrient();
     
    695695
    696696        nutrientGrowth();
    697         if (ExpParams.logging == 1)
     697        if (ExpProperties.logging == 1)
    698698        {
    699699                createStatistics();
     
    702702        //reproduction --------------------------------------------
    703703        reprocounter += 1;
    704         if (reprocounter*ExpParams.secPerStep > ExpParams.repro_time)
     704        if (reprocounter*ExpProperties.secPerStep > ExpProperties.repro_time)
    705705        {
    706706                reprocounter = 0;
     
    712712        if (Populations[0].size == 0)
    713713        {
    714                 if (ExpParams.autorestart)
     714                if (ExpProperties.autorestart)
    715715                {
    716716                        Simulator.print("no more creatures, restarting...");
     
    723723                }
    724724        }
    725         if (ExpParams.maxSteps > 0)
    726         {
    727                 if (Simulator.stepNumber >= ExpParams.maxSteps)
     725        if (ExpProperties.maxSteps > 0)
     726        {
     727                if (Simulator.stepNumber >= ExpProperties.maxSteps)
    728728                        Simulator.stop();
    729729        }
     
    778778~
    779779
    780 prop:
     780property:
    781781id:visualize
    782782name:Show reticulopodia and nutrients
     
    784784group:Foraminifera
    785785
    786 prop:
     786property:
    787787id:maxSteps
    788788name:Stop after the given number of simulation steps
    789789type:d 0 1000000 0
    790790
    791 prop:
     791property:
    792792id:foramSpeedMmPerMin
    793793name:Speed of foraminfera in mm/min
     
    796796group:Foraminifera
    797797
    798 prop:
     798property:
    799799id:gametSuccessRate
    800800name:Ratio of successful gamets
     
    802802group:Foraminifera
    803803
    804 prop:
     804property:
    805805id:gametoPeriod
    806806name:Time of gametogenesis
     
    808808group:Foraminifera
    809809
    810 prop:
     810property:
    811811id:picoCarbonPerMikro
    812812name:Picograms of carbon in cubed micrometer
     
    814814group:Foraminifera
    815815
    816 prop:
     816property:
    817817id:secPerStep
    818818name:Seconds per simulation step
     
    821821group:Foraminifera
    822822
    823 prop:
     823property:
    824824id:e_repro_cost_haplo
    825825name:Cost of reproduction
     
    827827group:Foraminifera
    828828
    829 prop:
     829property:
    830830id:divisionCost
    831831name:Cost of division in pG
     
    833833group:Foraminifera
    834834
    835 prop:
     835property:
    836836id:e_repro_cost_diplo
    837837name:Cost of reproduction
     
    839839group:Foraminifera
    840840
    841 prop:
     841property:
    842842id:chamber_growth_time
    843843name:Time of the chamber growth in seconds
     
    845845group:Foraminifera
    846846
    847 prop:
     847property:
    848848id:chamberCostPerSec
    849849name:Cost of growning chamber per second
     
    851851group:Foraminifera
    852852
    853 prop:
     853property:
    854854id:chamber_proculus_haplo
    855855name:Size of proculus
     
    857857group:Foraminifera
    858858
    859 prop:
     859property:
    860860id:chamber_proculus_diplo
    861861name:Size of proculus
     
    863863group:Foraminifera
    864864
    865 prop:
     865property:
    866866id:chamber_difference_haplo
    867867name:Difference in size between subsequent chambers
     
    869869group:Foraminifera
    870870
    871 prop:
     871property:
    872872id:chamber_difference_diplo
    873873name:Difference in size between subsequent chambers
     
    875875group:Foraminifera
    876876
    877 prop:
     877property:
    878878id:hunted_prob
    879879name:Probability of being hunted
     
    881881group:Forminifera
    882882
    883 prop:
     883property:
    884884id:zone1_range
    885885name:Zone 1 range
     
    887887group:Foraminifera
    888888
    889 prop:
     889property:
    890890id:zone2_range
    891891name:Zone 2 range
     
    893893group:Foraminifera
    894894
    895 prop:
     895property:
    896896id:colors
    897897name:Haploid and diploid colors
     
    899899group:Foraminifera
    900900
    901 prop:
     901property:
    902902id:min_repro_energ_haplo
    903903name:Min reproduction energy of forams
     
    905905group:Foraminifera
    906906
    907 prop:
     907property:
    908908id:min_repro_energ_diplo
    909909name:Min reproduction energy of forams
     
    911911group:Foraminifera
    912912
    913 prop:
     913property:
    914914id:repro_prob
    915915name:Probability of reproduction
     
    917917group:Foraminifera
    918918
    919 prop:
     919property:
    920920id:energies0_haplo
    921921name:Energy of offspring from diploid forams
     
    923923group:Foraminifera
    924924
    925 prop:
     925property:
    926926id:energies0_diplo
    927927name:Energy of offspring from diploid forams
     
    929929group:Foraminifera
    930930
    931 prop:
     931property:
    932932id:e_death_level_haplo
    933933name:Minimal level of energy to sustain life of haploid
     
    935935group:Foraminifera
    936936
    937 prop:
     937property:
    938938id:e_death_level_diplo
    939939name:Minimal level of energy to sustain life of diploid
     
    941941group:Foraminifera
    942942
    943 prop:
     943property:
    944944id:energy_hib
    945945name:Energy used for hibernation during one step
     
    947947group:Foraminifera
    948948
    949 prop:
     949property:
    950950id:energy_move
    951951name:Energy used for movement during one step
     
    953953group:Foraminifera
    954954
    955 prop:
     955property:
    956956id:min_vol
    957957name:Minimal volume for reproduction
     
    959959group:Foraminifera
    960960
    961 prop:
     961property:
    962962id:max_size
    963963name:Maximal size
     
    965965group:Foraminifera
    966966
    967 prop:
     967property:
    968968id:foramPop
    969969name:Initial forams population size
     
    971971group:Foraminifera
    972972
    973 prop:
     973property:
    974974id:crossprob
    975975name:Crossover probability
     
    977977group:Foraminifera
    978978
    979 prop:
     979property:
    980980id:mutationprob
    981981name:Mutation probability
     
    983983group:Foraminifera
    984984
    985 prop:
     985property:
    986986id:e_meta
    987987name:Idle metabolism
     
    990990help:Each stick consumes this amount of energy in one time step
    991991
    992 prop:
     992property:
    993993id:feedrate
    994994name:Feeding rate
     
    997997help:How fast energy is created in the world
    998998
    999 prop:
     999property:
    10001000id:foodPeriodChange
    10011001name:Set variable feed rate
     
    10031003group:Energy
    10041004
    1005 prop:
     1005property:
    10061006id:ingestion
    10071007name:Ingestion rate
     
    10091009group:Energy
    10101010
    1011 prop:
     1011property:
    10121012id:energy_nut
    10131013name:Nutrient energy
     
    10151015group:Energy
    10161016
    1017 prop:
     1017property:
    10181018id:feedtrans
    10191019name:Energy transfer per second
     
    10211021group:Energy
    10221022
    1023 prop:
     1023property:
    10241024id:foodperiod
    10251025name:Time between food occurrences
     
    10271027group:Energy
    10281028
    1029 prop:
     1029property:
    10301030id:nutrientradius
    10311031name:Nutrient size
     
    10331033group:Energy
    10341034
    1035 prop:
     1035property:
    10361036id:stress
    10371037name:Environmental stress
     
    10391039group:World
    10401040
    1041 prop:
     1041property:
    10421042id:repro_trigger
    10431043name:Reproduction trigger
     
    10451045group:World
    10461046
    1047 prop:
     1047property:
    10481048id:repro_time
    10491049name:Time before reproduction
    10501050type:d 0 10000
    10511051
    1052 prop:
     1052property:
    10531053id:creath
    10541054name:Creation height
     
    10681068flags:32
    10691069
    1070 prop:
     1070property:
    10711071id:autorestart
    10721072name:Restart after extinction
     
    10891089flags:16
    10901090
    1091 prop:
     1091property:
    10921092id:logging
    10931093name:Log statistics to file
  • experiments/frams/foraminifera/data/scripts/foraminifera.inc

    r479 r486  
    7474        var number = 1;
    7575        var result = parent_energy;
    76         while ((result-ExpParams.divisionCost) >= energy0)
    77         {
    78                 result = (result-ExpParams.divisionCost)/2;
     76        while ((result-ExpProperties.divisionCost) >= energy0)
     77        {
     78                result = (result-ExpProperties.divisionCost)/2;
    7979                number *= 2;
    8080        }
     
    100100                var offspring2 = gametsDivision(parent2.energy,getProperty(1,"energies0"));
    101101                energy0 = (offspring1->energy+offspring2->energy);
    102                 number = ExpParams.gametSuccessRate*(offspring1->number+offspring2->number)/2;
     102                number = ExpProperties.gametSuccessRate*(offspring1->number+offspring2->number)/2;
    103103                new_genes = [parent.data->genes, parent2.data->genes];
    104104                gen = 1 - parent.data->lifeparams->gen;
     
    124124                var crossed = 0;
    125125                //crossover
    126                 if (Math.rnd01 < ExpParams.crossprob)
     126                if (Math.rnd01 < ExpProperties.crossprob)
    127127                {
    128128                        crossover(parent, "min_repro_energies");
     
    154154                        if (pop[i].data->lifeparams->reproduce == 1 && pop[i].data->lifeparams->species == species)
    155155                        {
    156                                 if ((pop[i].data->lifeparams->gen==1) || ((pop[i].data->lifeparams->gen==0) && ExpParams.stress == 0))
     156                                if ((pop[i].data->lifeparams->gen==1) || ((pop[i].data->lifeparams->gen==0) && ExpProperties.stress == 0))
    157157                                {
    158158                                        continue;
     
    171171                                        if (parent1.data->lifeparams->division_time == -1 && parent2.data->lifeparams->division_time == -1)
    172172                                        {
    173                                                 var time = int(ExpParams.gametoPeriod/ExpParams.secPerStep);
     173                                                var time = int(ExpProperties.gametoPeriod/ExpProperties.secPerStep);
    174174                                                parent1.data->lifeparams->division_time = time;
    175175                                                parent2.data->lifeparams->division_time = time;
     
    206206        }
    207207
    208         else if (ExpParams.stress == 0)
     208        else if (ExpProperties.stress == 0)
    209209        {
    210210                reproduce_haploid(cr, null, 1);
     
    256256        {
    257257                //reproduce with probability repro_prob
    258                 if (Math.rnd01 <= ExpParams.repro_prob) //TODO env trigger
     258                if (Math.rnd01 <= ExpProperties.repro_prob) //TODO env trigger
    259259                {
    260260                        reproduced = readyToRepro(cr);
  • experiments/frams/foraminifera/data/scripts/foraminifera.show

    r474 r486  
    2424        TrackingCam.cam_h = 15; //more side view
    2525        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         ShowParams.visualize=1;
     26        ShowProperties.visualize=1;
    2727}
    2828
     
    3131        //just a draft, this function and all constants in expdef need serious review
    3232        var localDriveMicronsPerStep=framsToMicrons(getMovePerStep());
    33         var foramSpeedMmPerSec=ExpParams.foramSpeedMmPerMin/60;
     33        var foramSpeedMmPerSec=ExpProperties.foramSpeedMmPerMin/60;
    3434        var localDriveMmPerStep=localDriveMicronsPerStep/1000;
    3535        var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
     
    5454function setShowParam(param_id)
    5555{
    56         ExpParams.[param_id] = Params[param_id][ShowParams.[param_id]];
     56        ExpProperties.[param_id] = Params[param_id][ShowProperties.[param_id]];
    5757}
    5858
    59 function ShowParams_feedrate_set()
     59function ShowProperties_feedrate_set()
    6060{
    6161        setShowParam("feedrate");
    6262}
    6363
    64 function ShowParams_feedtrans_set()
     64function ShowProperties_feedtrans_set()
    6565{
    6666        setShowParam("feedtrans");
    6767}
    6868
    69 function ShowParams_energy_nut_set()
     69function ShowProperties_energy_nut_set()
    7070{
    7171        setShowParam("energy_nut");
    7272}
    7373
    74 function ShowParams_stress_set()
     74function ShowProperties_stress_set()
    7575{
    7676        setShowParam("stress");
    7777}
    7878
    79 function ShowParams_visualize_set()
     79function ShowProperties_visualize_set()
    8080{
    8181        setShowParam("visualize");
     
    8484~
    8585
    86 prop:
     86property:
    8787id:feedrate
    8888name:Feeding rate
    8989type:d 0 2 1 ~Low~Medium~High
    9090
    91 prop:
     91property:
    9292id:feedtrans
    9393name:Energy transfer
    9494type:d 0 2 1 ~0.05~0.125~0.25
    9595
    96 prop:
     96property:
    9797id:energy_nut
    9898name:Nutrient energy
    9999type:d 0 2 1 ~0.5~1.5~3
    100100
    101 prop:
     101property:
    102102id:stress
    103103name:Stress
    104104type:d 0 1 1
    105105
    106 prop:
     106property:
    107107id:visualize
    108108name:Enhance visualization
Note: See TracChangeset for help on using the changeset viewer.