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

Last change on this file since 454 was 454, checked in by oriona, 8 years ago

Show name changed.

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