source: experiments/frams/foraminifera/data/scripts/foraminifera.show @ 449

Last change on this file since 449 was 449, checked in by Maciej Komosinski, 8 years ago

Added a TODO comment

File size: 3.1 KB
RevLine 
[401]1show:
[406]2name:Reproduction of benthic foraminifera
[401]3info:~
[434]4There 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.
[422]5
[444]6Nutrients are shown as tiny green cylinders. Foraminifers move towards nearest nutrients and this way they can accumulate enough energy to reproduce.
[434]7
[446]8When the "Enhance visualization" option is enabled, reticulopodia are shown as large disks and positions of nutrients are indicated by cuboids. 
[444]9
[407]10More information at www.framsticks.com/foraminifera
[401]11~
[406]12expdef:foraminifera
[401]13code:~
14
[446]15global Params; //to easily transfer changes in identical properties from this show to expdef
[448]16global last_simspeed; //to display time scale when it changes significantly
[423]17
[401]18function onLoad()
19{
20        Simulator.init();
[448]21        last_simspeed=0;
[401]22        GLDisplay.desiredsimspeed = 50;
23        GLDisplay.minfps = 10;
[442]24        TrackingCam.cam_h = 15; //more side view
[444]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]};
[446]26        ShowParams.visualize=1;
[401]27}
[423]28
[446]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
[449]33        var localDriveMicronsPerStep=framsToMicrons(0.08); //0.08 is used in expdef as distance (in frams units) per simulation step. TODO Use a variable/constant/function from expdef instead of copying this value here
[446]34        var foramSpeedMmPerSec=foramSpeedMmPerMin/60;
35        var localDriveMmPerStep=localDriveMicronsPerStep/1000;
36        var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
37        return localDriveMmPerSec/foramSpeedMmPerSec;
38}
39
[448]40function updateBanner()
[446]41{
42        GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000);
[448]43        GLDisplay.banner+="\nShowing real-time x %g." % timeScale();
[446]44}
45
46function onShowStep()
47{
[448]48        if (Simulator.simspeed<last_simspeed*0.9 || Simulator.simspeed>last_simspeed*1.1) //significant change
[446]49        {
[448]50                updateBanner();
51                last_simspeed=Simulator.simspeed;
[446]52        }
53}
54
[423]55function setShowParam(param_id)
56{
57        ExpParams.[param_id] = Params[param_id][ShowParams.[param_id]];
58}
59
60function ShowParams_feedrate_set()
[401]61{
[423]62        setShowParam("feedrate");
[401]63}
64
[423]65function ShowParams_feedtrans_set()
[401]66{
[423]67        setShowParam("feedtrans");
[401]68}
69
[423]70function ShowParams_energy_nut_set()
[401]71{
[423]72        setShowParam("energy_nut");
[401]73}
74
[422]75function ShowParams_stress_set()
76{
[423]77        setShowParam("stress");
[422]78}
79
[444]80function ShowParams_visualize_set()
81{
82        setShowParam("visualize");
83}
84
[401]85~
86
[422]87prop:
[423]88id:feedrate
[422]89name:Feeding rate
[423]90type:d 0 2 1 ~Low~Medium~High
[401]91
92prop:
[423]93id:feedtrans
[422]94name:Energy transfer
95type:d 0 2 1 ~0.01~0.05~0.1
[401]96
97prop:
[423]98id:energy_nut
[422]99name:Nutrient energy
100type:d 0 2 1 ~0.5~1.5~3
[401]101
102prop:
[422]103id:stress
104name:Stress
105type:d 0 1 1
[444]106
107prop:
108id:visualize
109name:Enhance visualization
110type:d 0 1 0
Note: See TracBrowser for help on using the repository browser.