Ignore:
Timestamp:
11/26/15 21:51:13 (9 years ago)
Author:
oriona
Message:

Visualization of reticulopodia and nutrients added as an option in theater.

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

Legend:

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

    r435 r444  
    6464        //pop.othermask = 0x10002;
    6565
    66         //ExpParams.showRet = 1; //uncomment to show reticulopodia
    67 
    68         pop = Populations.addGroup("Reticulopodia");
     66        pop = Populations.addGroup("ReticulopodiaNutrients");
    6967        pop.nnsim = 0;
    7068        pop.enableperf = 0;
     
    7371        pop.selfmask = 0x20002;
    7472        pop.othermask = 0x10000;
    75        
     73
    7674        //world
    7775        SignalView.mode = 1;
     
    8381        ExpParams.autorestart = 0;
    8482
     83        //ExpParams.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions
     84
    8585        //ExpParams.logging = 1; //uncomment to enable logging simulation parameters to log files
    8686
     
    9494        //morphology
    9595        dir_change = 500;
    96         ExpParams.zone1_range = scale(5000);
    97         ExpParams.zone2_range = scale(8000);
     96        ExpParams.zone1_range = scale(3000);
     97        ExpParams.zone2_range = scale(6000);
    9898        init_chambers();
    9999        ExpParams.chamber_proculus_haplo = scale(50);
     
    163163        Populations[0].clear();
    164164        Populations[1].clear();
    165         Populations[2].clear();
     165        Populations[2].clear(); //reticulopodia and nutrients
    166166
    167167        for (var i = 0; i < ExpParams.foramPop; i++)
     
    253253{
    254254        setForamMeta(cr, 1);
    255         if (ExpParams.showRet == 1)
    256         {
    257                 var ret = Populations[2].add("//0\np:sh=3,sx=0.01,sy="+ExpParams.zone1_range+",sz="+ExpParams.zone1_range+",ry=1.57");
     255        if (ExpParams.visualize == 1)
     256        {
     257                var ret = Populations[2].add("//0\np:sh=3,sx=0.01,sy="+ExpParams.zone1_range+",sz="+ExpParams.zone1_range+",ry=1.57,vr=0.0,1.0,0.0");
    258258                cr.user3 = ret;
    259259        }
     
    273273}
    274274
     275function visualization(cr)
     276{
     277        var has_ret = 0;
     278
     279        if (cr.user3 != null)
     280        {
     281                if (Populations[2].findUID(cr.user3.uid) != null)
     282                {
     283                        has_ret = 1;
     284                }
     285        }
     286
     287        return has_ret;
     288}
     289
    275290function foramGrow(cr, chamber_num)
    276291{
     
    285300        setForamMeta(cr2, cr2.user2["gen"]);
    286301
    287         if (ExpParams.showRet == 1)
     302        if (visualization(cr))
    288303        {
    289304                Populations[2].delete(cr.user3);
     
    419434{
    420435        cr.getMechPart(0).orient.set(o);
    421         if (ExpParams.showRet == 1)
     436        if (visualization(cr))
     437        {
    422438                cr.user3.moveAbs(cr.center_x-ExpParams.zone1_range, cr.center_y-ExpParams.zone1_range, cr.center_z-ExpParams.zone1_range-getProperty(cr.user2["gen"], "chamber_proculus"));
     439        }
    423440
    424441        if (deathConditions(cr) == 1)
     
    456473function onForamsDied(cr)
    457474{
    458         if (ExpParams.showRet == 1)
     475        if (visualization(cr))
    459476        {
    460477                Populations[2].delete(cr.user3);
     
    474491function createNutrientGenotype(nutrientsize, zone1_range)
    475492{
    476         return "//0\np:sh=3,sx="+(nutrientsize+25)+",sy="+nutrientsize+",sz="+nutrientsize+",ry=1.5,vr=0.0,1.0,0.0";
     493        return "//0\np:sh=3,sx="+nutrientsize+",sy="+nutrientsize+",sz="+nutrientsize+",ry=1.5,vr=0.0,1.0,0.0";
    477494}
    478495
    479496function onNutrientsStep(cr)
    480497{
    481         cr.moveAbs(cr.pos_x % World.wrldsiz, cr.pos_y % World.wrldsiz, -ExpParams.zone1_range+0.5);
     498        cr.moveAbs(cr.pos_x % World.wrldsiz, cr.pos_y % World.wrldsiz, 0.5);
    482499}
    483500
     
    495512
    496513        placeCreatureRandomly(cr, 0, 0);
     514        if (ExpParams.visualize == 1)
     515        {
     516                var nutsize = ExpParams.nutrientsize*10;
     517                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");
     518                cr.user3 = nut;
     519                nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, 0.5);
     520        }
     521}
     522
     523function onNutrientsDied(cr)
     524{
     525        if (visualization(cr))
     526        {
     527                Populations[2].delete(cr.user3);
     528        }
    497529}
    498530
     
    603635
    604636prop:
    605 id:showRet
    606 name:Show reticulopodia
     637id:visualize
     638name:Show reticulopodia and nutrients
    607639type:d 0 1 0
    608640group:Foraminifera
  • experiments/frams/foraminifera/data/scripts/foraminifera.show

    r442 r444  
    44There are two species of Foraminiera: longitudal and coiled. The first chamber of the longitudal species has orange marks. Haploid and diploid generations alternate in both species. All chambers of the haploid generation have the same size. In the diploid generation, subsequent chambers are bigger than their predecessors.
    55
    6 Nutrients are shown as tall vertical bars. Foraminifers move towards nearest nutrients and this way they can accumulate enough energy to reproduce.
     6Nutrients are shown as tiny green cylinders. Foraminifers move towards nearest nutrients and this way they can accumulate enough energy to reproduce.
     7
     8After "Enhance visualization" option is enabled reticulopodia are shown as disks and positions of nutrients are indicated by cuboids. 
    79
    810More information at www.framsticks.com/foraminifera
     
    2022        TrackingCam.cam_h = 15; //more side view
    2123
    22         Params = { "feedrate" : [0.05,0.1,0.2], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1]};
     24        Params = { "feedrate" : [0.05,0.1,0.2], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1], "visualize" : [0,1]};
    2325}
    2426
     
    4850}
    4951
     52function ShowParams_visualize_set()
     53{
     54        setShowParam("visualize");
     55}
     56
    5057~
    5158
     
    6976name:Stress
    7077type:d 0 1 1
     78
     79prop:
     80id:visualize
     81name:Enhance visualization
     82type:d 0 1 0
Note: See TracChangeset for help on using the changeset viewer.