Changeset 446


Ignore:
Timestamp:
11/27/15 01:00:43 (8 years ago)
Author:
Maciej Komosinski
Message:

Added comments and displaying reference to real-world units: size and clock speed

File:
1 edited

Legend:

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

    r444 r446  
    66Nutrients are shown as tiny green cylinders. Foraminifers move towards nearest nutrients and this way they can accumulate enough energy to reproduce.
    77
    8 After "Enhance visualization" option is enabled reticulopodia are shown as disks and positions of nutrients are indicated by cuboids. 
     8When the "Enhance visualization" option is enabled, reticulopodia are shown as large disks and positions of nutrients are indicated by cuboids. 
    99
    1010More information at www.framsticks.com/foraminifera
     
    1313code:~
    1414
    15 global Params;
     15global Params; //to easily transfer changes in identical properties from this show to expdef
     16global lasttimescale; //to display time scale when it changes significantly
    1617
    1718function onLoad()
    1819{
    1920        Simulator.init();
     21        lasttimescale=0;
    2022        GLDisplay.desiredsimspeed = 50;
    2123        GLDisplay.minfps = 10;
    2224        TrackingCam.cam_h = 15; //more side view
     25        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]};
     26        ShowParams.visualize=1;
     27}
    2328
    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]};
     29function timeScale()
     30{
     31        //just a draft, this function and all constants in expdef need serious review
     32        var foramSpeedMmPerMin=0.1; //0.1 mm/minute based on http://drs.nio.org/drs/bitstream/handle/2264/418/ONGC_Bull_37%281%29_53.pdf
     33        var localDriveMicronsPerStep=framsToMicrons(0.08); //0.08 is used in expdef as distance (in frams units) per simulation step
     34        var foramSpeedMmPerSec=foramSpeedMmPerMin/60;
     35        var localDriveMmPerStep=localDriveMicronsPerStep/1000;
     36        var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
     37        return localDriveMmPerSec/foramSpeedMmPerSec;
     38}
     39
     40function updateBanner(timescale)
     41{
     42        GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000);
     43        GLDisplay.banner+="\nShowing real-time x %g." % timescale;
     44}
     45
     46function onShowStep()
     47{
     48        var timescale=timeScale();
     49        if (timescale<lasttimescale*0.9 || timescale>lasttimescale*1.1) //significant change
     50        {
     51                updateBanner(timescale);
     52                lasttimescale=timescale;
     53        }
    2554}
    2655
Note: See TracChangeset for help on using the changeset viewer.