Changeset 423 for experiments/frams


Ignore:
Timestamp:
08/25/15 15:33:31 (9 years ago)
Author:
oriona
Message:

corrected properties definitions, added function for setting show parameters

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

Legend:

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

    r422 r423  
    557557prop:
    558558id:e_repro_cost_haplo
    559 name:cost of reproduction
     559name:Cost of reproduction
    560560type:f 0.1 0.9 0.5
    561561group:Foraminifera
     
    563563prop:
    564564id:e_repro_cost_diplo
    565 name:cost of reproduction
     565name:Cost of reproduction
    566566type:f 0.1 0.9 0.3
    567567group:Foraminifera
     
    569569prop:
    570570id:chamber_proculus_haplo
    571 name:size of proculus
     571name:Size of proculus
    572572type:f
    573573group:Foraminifera
     
    575575prop:
    576576id:chamber_proculus_diplo
    577 name:size of proculus
     577name:Size of proculus
    578578type:f
    579579group:Foraminifera
     
    581581prop:
    582582id:chamber_difference_haplo
    583 name:difference in size between subsequent chambers
     583name:Difference in size between subsequent chambers
    584584type:f
    585585group:Foraminifera
     
    587587prop:
    588588id:chamber_difference_diplo
    589 name:difference in size between subsequent chambers
     589name:Difference in size between subsequent chambers
    590590type:f
    591591group:Foraminifera
     
    689689prop:
    690690id:e_death_level
    691 name:Level of energy ... death
    692 type:f 0
     691name:Minimal level of energy to sustain life
     692type:f 0 20 0
    693693group:Foraminifera
    694694
     
    723723id:nutrientsize
    724724name:Nutrients's size
    725 type:f 0.1
     725type:f 0.1 0.9 0.1
    726726group:Energy
    727727
  • experiments/frams/foraminifera/data/scripts/foraminifera.show

    r422 r423  
    1313code:~
    1414
     15global Params;
     16
    1517function onLoad()
    1618{
     
    1820        GLDisplay.desiredsimspeed = 50;
    1921        GLDisplay.minfps = 10;
     22
     23        Params = {"nutrientPop" : [5,10,15], "feedrate" : [0.001,0.0025,0.004], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1]};
    2024}
     25
     26function setShowParam(param_id)
     27{
     28        ExpParams.[param_id] = Params[param_id][ShowParams.[param_id]];
     29}
     30
    2131function ShowParams_nutrientPop_set()
    2232{
    23         switch (ShowParams.nutrientPop)
    24         {
    25         case 0:
    26                 ExpParams.nutrientPop = 5;
    27                 break;
    28         case 1:
    29                 ExpParams.nutrientPop = 10;
    30                 break;
    31         case 2:
    32                 ExpParams.nutrientPop = 15;
    33                 break;
    34         }
     33        setShowParam("nutrientPop");
    3534}
    3635
    37 function ShowParams_feedRate_set()
     36function ShowParams_feedrate_set()
    3837{
    39         switch (ShowParams.feedRate)
    40         {
    41         case 0:
    42                 ExpParams.feedrate = 0.001;
    43                 break;
    44         case 1:
    45                 ExpParams.feedrate = 0.0025;
    46                 break;
    47         case 2:
    48                 ExpParams.feedrate = 0.004;
    49                 break;
    50         }
     38        setShowParam("feedrate");
    5139}
    5240
    53 function ShowParams_feedTrans_set()
     41function ShowParams_feedtrans_set()
    5442{
    55         switch (ShowParams.feedTrans)
    56         {
    57         case 0:
    58                 ExpParams.feedtrans = 0.01;
    59                 break;
    60         case 1:
    61                 ExpParams.feedtrans = 0.05;
    62                 break;
    63         case 2:
    64                 ExpParams.feedtrans = 0.1;
    65                 break;
    66         }
     43        setShowParam("feedtrans");
    6744}
    6845
    69 function ShowParams_nutrientEnerg_set()
     46function ShowParams_energy_nut_set()
    7047{
    71         switch (ShowParams.nutrientEnerg)
    72         {
    73         case 0:
    74                 ExpParams.energy_nut = 0.5;
    75                 break;
    76         case 1:
    77                 ExpParams.energy_nut = 1.5;
    78                 break;
    79         case 2:
    80                 ExpParams.energy_nut = 3.0;
    81                 break;
    82         }
     48        setShowParam("energy_nut");
    8349}
    8450
    8551function ShowParams_stress_set()
    8652{
    87         switch (ShowParams.stress)
    88         {
    89         case 0:
    90                 ExpParams.stress = 0;
    91                 break;
    92         case 1:
    93                 ExpParams.stress = 1;
    94                 break;
    95         }
     53        setShowParam("stress");
    9654}
    9755
     
    10462
    10563prop:
    106 id:feedRate
     64id:feedrate
    10765name:Feeding rate
    108 type:d 0 2 1 ~1~2~3
     66type:d 0 2 1 ~Low~Medium~High
    10967
    11068prop:
    111 id:feedTrans
     69id:feedtrans
    11270name:Energy transfer
    11371type:d 0 2 1 ~0.01~0.05~0.1
    11472
    11573prop:
    116 id:nutrientEnerg
     74id:energy_nut
    11775name:Nutrient energy
    11876type:d 0 2 1 ~0.5~1.5~3
Note: See TracChangeset for help on using the changeset viewer.