Ignore:
Timestamp:
09/08/15 23:37:28 (9 years ago)
Author:
oriona
Message:

Minor corrections, hibernation gene value changed to 1, param for stopping simulation added

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

Legend:

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

    r431 r432  
    1313max_energy_level - maximum energy level reached so far
    1414gen - generation: 0 haploid, 1 diploid
    15 species - species: 0 hibernating 1 not hibernating
    16 hibernated - 0/1 foram isn't/is hibernated
     15species - species: 0 not hibernating 1 hibernating
     16hibernated - 0/1 foram is/isn't hibernated
    1717reproduce - 0/1 foram isn't/is ready for reproduction
    1818~
     
    8181        //world
    8282        SignalView.mode = 1;
    83         ExpParams.world_size = scale(40000);
    8483        World.wrldwat = 200;
    85         World.wrldsiz = ExpParams.world_size;
     84        World.wrldsiz = scale(40000);
    8685        World.wrldbnd = 1;
    8786        ExpParams.stress = 1;
     
    138137        ExpState.totaltestedcr = 0;
    139138        ExpState.nutrient = "";
     139
     140        ExpParams.iter = 0;
    140141}
    141142
     
    236237        ExpState.nutrient = tmpvec;
    237238        File.writeObject(sim_params.*);
    238         ExpState.nutrient = null; //vectors are only created for saving and then discardedsetForam
     239        ExpState.nutrient = null; //vectors are only created for saving and then discarded
    239240
    240241        for (var cr in Populations[0])
     
    387388        else if (cr.lifespan%dir_change == 0)
    388389        {
    389                 var dir = (Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), 0);//(0.1 * Math.rnd01, 0.1 * Math.rnd01, 0);       
     390                var dir = (Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), Math.rndUni(-ExpParams.zone2_range, ExpParams.zone2_range), 0); 
    390391                dir.normalize();
    391392                dir.scale(-0.08);
     
    485486function onNutrientsStep(cr)
    486487{
    487         cr.moveAbs(cr.pos_x % ExpParams.world_size, cr.pos_y % ExpParams.world_size, -ExpParams.zone1_range+0.5);
     488        cr.moveAbs(cr.pos_x % World.wrldsiz, cr.pos_y % World.wrldsiz, -ExpParams.zone1_range+0.5);
    488489}
    489490
     
    509510        {
    510511                for (var i = 0; i < ExpParams.nutrientPop; i++)
    511                 {
     512                {   
    512513                        addNutrient();
    513514                }
     
    524525function onStep()
    525526{
     527
     528        nutrientGrowth();
    526529        if (ExpParams.logging == 1)
    527530        {
    528531                createStatistics();
    529532        }
    530 
    531         nutrientGrowth();
    532533
    533534        //reproduction --------------------------------------------
     
    554555                }
    555556        }
    556 
     557        if (ExpParams.stopping == 1)
     558        {
     559                if (Simulator.stepNumber == 150000)
     560                        Simulator.stop();
     561        }
    557562}
    558563
     
    579584        }
    580585
    581         var log_numbers = [number[0][0], number[0][1], number[1][0], number[1][1], Populations[1].size];
    582         var log_energies = [e_inc[0][0], e_inc[0][1], e_inc[1][0], e_inc[1][1], e_nut];
     586        var log_numbers = [number[1][0], number[1][1], number[0][0], number[0][1], Populations[1].size];
     587        var log_energies = [e_inc[1][0], e_inc[1][1], e_inc[0][0], e_inc[0][1], e_nut];
    583588
    584589        log(log_numbers, "forams_log.txt");
    585         log(log_energies, "energies_log.txt");
     590        log(log_energies,  "energies_log.txt");
    586591}
    587592
     
    609614type:d 0 1 0
    610615group:Foraminifera
     616
     617prop:
     618id:iter
     619name:Iteration number
     620type:d
     621
     622prop:
     623id:stopping
     624name:Stop after the given number of simulation steps
     625type:d 0 1 0
    611626
    612627prop:
     
    785800group:Energy
    786801type:d 1 1000 10
    787 
    788 prop:
    789 id:world_size
    790 name:World size
    791 type:d 10 10000 20
    792 group:World
    793802
    794803prop:
  • experiments/frams/foraminifera/data/scripts/foraminifera.inc

    r430 r432  
    55{
    66        colors = ["1.0,1.0,0.0","1.0,0.5,0.0"];
    7         chambers = [ ["0.0,0.0,0.0,", //longitudal
    8         "0.98089325428009, 0.00591040402650833, 0.00389722990803421,",
    9         "1.90962779521942, -0.256769120693207, -0.16194811463356,",
    10         "2.63965249061584, -0.727959632873535, -0.609036147594452,",
    11         "3.17575979232788, -1.34843015670776, -1.14828503131866,",
    12         "3.55273032188416, -2.22369408607483, -1.3917418718338,",
    13         "3.64916682243347, -3.11888360977173, -1.01666414737701,",
    14         "3.50461649894714, -3.84039807319641, -0.377427101135254,",
    15         "3.15921688079834, -4.50001525878906, 0.261153399944305,",
    16         "2.51528453826904, -5.16421365737915, 0.59241509437561,"],
    17         ["0.0,0.0,0.0,",  //coiled
     7        chambers = [ ["0.0,0.0,0.0,",  //coiled
    188        "1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
    199        "1.08020961284637, -0.0597195439040661, -0.0393781512975693,",
     
    2515        "1.0958571434021, 0.316927701234818, -1.813929438591,",
    2616        "0.903768002986908, 1.11856341362, -2.53161096572876,",
    27         "0.21014116704464, 0.295340299606323, -2.45328187942505,"] ];
     17        "0.21014116704464, 0.295340299606323, -2.45328187942505,"],
     18        ["0.0,0.0,0.0,", //longitudal
     19        "0.98089325428009, 0.00591040402650833, 0.00389722990803421,",
     20        "1.90962779521942, -0.256769120693207, -0.16194811463356,",
     21        "2.63965249061584, -0.727959632873535, -0.609036147594452,",
     22        "3.17575979232788, -1.34843015670776, -1.14828503131866,",
     23        "3.55273032188416, -2.22369408607483, -1.3917418718338,",
     24        "3.64916682243347, -3.11888360977173, -1.01666414737701,",
     25        "3.50461649894714, -3.84039807319641, -0.377427101135254,",
     26        "3.15921688079834, -4.50001525878906, 0.261153399944305,",
     27        "2.51528453826904, -5.16421365737915, 0.59241509437561,"]];
    2828}
    2929
     
    3737        for (var i = 0; i < chamber_num; i++)
    3838        {
    39                 rad = getProperty(gen, "chamber_proculus") + getProperty(gen, "chamber_difference") * (i + 1); 
     39                rad = getProperty(gen, "chamber_proculus") + getProperty(gen, "chamber_difference") * (i + 1);
    4040                geno += "\n" + "p:" + chambers[species][i+1] + "sh=1,sx=" + rad + ",sy=" + rad + ",sz=" + rad + ",vr=" + colors[gen];
    4141        }
     
    4646        }
    4747
    48         if (species == 1) geno += "\nn:p=0,d=\"S\"";
     48        if (species == 0) geno += "\nn:p=0,d=\"S\"";
    4949
    5050        return geno;
     
    5555        if (mode["opt"] == 0) //initial
    5656        {
    57                 mode["cr"].user1 = {"min_repro_energies" : [max_chamber_energ[0][getProperty(0, "min_repro_energ")], max_chamber_energ[1][getProperty(1, "min_repro_energ")]], "hibernation" : 1 - mode["species"]};
     57                mode["cr"].user1 = {"min_repro_energies" : [max_chamber_energ[0][getProperty(0, "min_repro_energ")], max_chamber_energ[1][getProperty(1, "min_repro_energ")]], "hibernation" : mode["species"]};
    5858                mode["cr"].user2 = {"max_energy_level" : getProperty(0,"energies0"), "gen" : 0,  "hibernated" : 0, "species" : mode["species"], "reproduce" : 0};
    5959        }
Note: See TracChangeset for help on using the changeset viewer.