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

Last change on this file since 496 was 496, checked in by oriona, 7 years ago

Haploid and diploid morphologies changed.

File size: 2.9 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 = { "foodperiod" : [43200,25920,10800], "feedtrans" : [0.0005,0.001,0.002],"energy_nut" :[144.54,544.54,944.54], "stress" : [0,1], "visualize" : [0,1]};
26        ShowProperties.visualize=1;
27}
28
29function timeScale()
30{
31        //just a draft, this function and all constants in expdef need serious review
32        var localDriveMicronsPerStep=framsToMicrons(getMovePerStep());
33        var foramSpeedMmPerSec=ExpProperties.foramSpeedMmPerMin/60;
34        var localDriveMmPerStep=localDriveMicronsPerStep/1000;
35        var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
36        return localDriveMmPerSec/foramSpeedMmPerSec;
37}
38
39function updateBanner()
40{
41        GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000);
42        GLDisplay.banner+="\nShowing real-time x %g." % timeScale();
43}
44
45function onShowStep()
46{
47        if (Simulator.simspeed<last_simspeed*0.9 || Simulator.simspeed>last_simspeed*1.1) //significant change
48        {
49                updateBanner();
50                last_simspeed=Simulator.simspeed;
51        }
52}
53
54function setShowParam(param_id)
55{
56        ExpProperties.[param_id] = Params[param_id][ShowProperties.[param_id]];
57}
58
59function ShowProperties_foodperiod_set()
60{
61        setShowParam("foodperiod");
62}
63
64function ShowProperties_feedtrans_set()
65{
66        setShowParam("feedtrans");
67}
68
69function ShowProperties_energy_nut_set()
70{
71        setShowParam("energy_nut");
72}
73
74function ShowProperties_stress_set()
75{
76        setShowParam("stress");
77}
78
79function ShowProperties_visualize_set()
80{
81        setShowParam("visualize");
82}
83
84~
85
86property:
87id:foodperiod
88name:Feeding period
89type:d 0 2 1 ~Low~Medium~High
90
91property:
92id:feedtrans
93name:Energy transfer
94type:d 0 2 1 ~0.05~0.125~0.25
95
96property:
97id:energy_nut
98name:Nutrient energy
99type:d 0 2 1 ~0.5~1.5~3
100
101property:
102id:stress
103name:Stress
104type:d 0 1 1
105
106property:
107id:visualize
108name:Enhance visualization
109type:d 0 1 0
Note: See TracBrowser for help on using the repository browser.