Changeset 590 for experiments/frams


Ignore:
Timestamp:
08/22/16 01:26:47 (8 years ago)
Author:
oriona
Message:

Feed period changed to food flux in grams per square meter per second. Theater parameters updated.

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

Legend:

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

    r588 r590  
    2727global max_chamber_volume;
    2828global movePerStep;
    29 global nutrientenergywaiting;
    3029global reprocounter;
    3130global changePeriod;
     
    3736global chamber_vis_denominator;
    3837global curRadius;
     38global nutrient_num_counter;
     39global wrldsizSquareMeters;
    3940
    4041@include "foraminifera.inc"
     
    8586        World.wrldwat = 200;
    8687        World.wrldsiz = micronsToFrams(100000);
     88        wrldsizSquareMeters = Math.pow(framsToMicrons(World.wrldsiz)*0.000001,2);
    8789        World.wrldbnd = 1;
    8890
     
    166168
    167169        reprocounter = 0;
    168         nutrientenergywaiting = 0;
     170        nutrient_num_counter = 0;
    169171        changePeriod = 0;
    170172        phase = "low";
     
    801803}
    802804
     805function getNumberCounter(counter, increase, unit)
     806{
     807        var result = 0;
     808        counter += increase;
     809        result = int(counter/unit);
     810        counter -= result*unit;
     811        return {"counter" : counter, "number" : result};
     812}
     813
    803814function nutrientGrowth()
    804815{
    805         if (ExpProperties.foodPeriodChange > 0)
     816        if (ExpProperties.foodfluxChange > 0)
    806817        {
    807818                        changePeriod += 1;
    808819                        if (phase=="low" && changePeriod >= secToSimSteps(23328000)) //9 months
    809820                        {
    810                                 ExpProperties.foodperiod = ExpProperties.foodperiod/ExpProperties.foodPeriodChange;
     821                                ExpProperties.foodflux = ExpProperties.foodflux/ExpProperties.foodfluxChange;
    811822                                phase = "high";
    812823                                changePeriod = 0;
     
    815826                        else if (phase == "high" && changePeriod >= secToSimSteps(7776000)) //3 months
    816827                        {
    817                                 ExpProperties.foodperiod = ExpProperties.foodperiod*ExpProperties.foodPeriodChange;
     828                                ExpProperties.foodflux = ExpProperties.foodflux*ExpProperties.foodfluxChange;
    818829                                phase = "low";
    819830                                changePeriod = 0;
    820831                        }
    821832        }
    822         nutrientenergywaiting = nutrientenergywaiting + 1;
    823         if (nutrientenergywaiting >= secToSimSteps(ExpProperties.foodperiod))
    824         {
    825                 for (var i = 0; i < ExpProperties.nutrient_pop; i++)
    826                 {   
    827                         addNutrient();
    828                 }
    829 
    830                 nutrientenergywaiting = 0.0;
    831                 Simulator.checkpoint();
    832 
    833                 if (ExpProperties.logging == 1)
    834                 {
    835                         log([ExpProperties.nutrient_pop],ExpProperties.logPref+"nutrients_log.txt");
    836                 }
     833
     834        var nutrientNum = getNumberCounter(nutrient_num_counter, ExpProperties.foodflux*wrldsizSquareMeters*ExpProperties.secPerStep,ExpProperties.energy_nut*0.000000000001);
     835
     836        nutrient_num_counter = nutrientNum["counter"];
     837
     838        for (var i = 0; i < nutrientNum["number"]; i++)
     839        {   
     840                addNutrient();
     841        }
     842
     843        if (ExpProperties.logging == 1 && nutrientNum["number"] > 0)
     844        {
     845                log([nutrientNum["number"]],ExpProperties.logPref+"nutrients_log.txt");
    837846        }
    838847
     
    12161225
    12171226property:
    1218 id:foodperiod
    1219 name:Time between food occurrences
    1220 type:f 0 1000000 14400
    1221 group:Energy
    1222 
    1223 property:
    1224 id:foodPeriodChange
     1227id:foodflux
     1228name:POM flux in grams per second per square meter
     1229type:f 0 1 0.0000000075631
     1230group:Energy
     1231
     1232property:
     1233id:foodfluxChange
    12251234name:Set variable feed rate
    12261235type:f 0 -1 0
  • experiments/frams/foraminifera/data/scripts/foraminifera.inc

    r581 r590  
    241241
    242242        //if creature has proper energy
    243         if ( properEnergy && cr.signals.size == 0)
     243        if ( properEnergy )
    244244        {
    245245                //reproduce with probability repro_prob
  • experiments/frams/foraminifera/data/scripts/foraminifera.show

    r569 r590  
    1919{
    2020        var nutrient_multiple = 200;
    21         Params = { "foodperiod" : [28800,14400,7200], "feedtrans" : [0.0005,0.001,0.002],"energy_nut" :[nutrient_multiple*144.54,nutrient_multiple*544.54,nutrient_multiple*944.54], "stress" : [0,1], "visualize" : [0,1]};
     21        Params = { "foodflux" : [0.0000000037815,0.0000000075631,0.000000015126], "feedtrans" : [0.0005,0.001,0.002],"energy_nut" :[nutrient_multiple*144.54,nutrient_multiple*544.54,nutrient_multiple*944.54], "stress" : [0,1], "visualize" : [0,1]};
    2222        ShowProperties.visualize=1;
    2323        ExpProperties.secPerStep=50;
     
    6363}
    6464
    65 function ShowProperties_foodperiod_set()
     65function ShowProperties_foodflux_set()
    6666{
    67         setShowParam("foodperiod");
     67        setShowParam("foodflux");
    6868}
    6969
     
    9191
    9292property:
    93 id:foodperiod
    94 name:Feeding period
     93id:foodflux
     94name:Food flux
    9595type:d 0 2 1 ~Low~Medium~High
    9696
     
    9898id:feedtrans
    9999name:Energy transfer
    100 type:d 0 2 1 ~0.05~0.125~0.25
     100type:d 0 2 1 ~0.0001~0.001~0.01
    101101
    102102property:
    103103id:energy_nut
    104104name:Nutrient energy
    105 type:d 0 2 1 ~0.5~1.5~3
     105type:d 0 2 1 ~28908~108908~188908
    106106
    107107property:
Note: See TracChangeset for help on using the changeset viewer.