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

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

Used secPerStep values added in help, setPerStep in show set to 50.

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