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

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

Parameters for time scaling added.

File size: 2.8 KB
RevLine 
[401]1show:
[454]2name: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
[474]25        Params = { "feedrate" : [200,100,50], "feedtrans" : [0.05,0.125,0.25],"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
[474]32        var localDriveMicronsPerStep=framsToMicrons(getMovePerStep());
33        var foramSpeedMmPerSec=ExpParams.foramSpeedMmPerMin/60;
[446]34        var localDriveMmPerStep=localDriveMicronsPerStep/1000;
35        var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
36        return localDriveMmPerSec/foramSpeedMmPerSec;
37}
38
[448]39function updateBanner()
[446]40{
41        GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000);
[448]42        GLDisplay.banner+="\nShowing real-time x %g." % timeScale();
[446]43}
44
45function onShowStep()
46{
[448]47        if (Simulator.simspeed<last_simspeed*0.9 || Simulator.simspeed>last_simspeed*1.1) //significant change
[446]48        {
[448]49                updateBanner();
50                last_simspeed=Simulator.simspeed;
[446]51        }
52}
53
[423]54function setShowParam(param_id)
55{
56        ExpParams.[param_id] = Params[param_id][ShowParams.[param_id]];
57}
58
59function ShowParams_feedrate_set()
[401]60{
[423]61        setShowParam("feedrate");
[401]62}
63
[423]64function ShowParams_feedtrans_set()
[401]65{
[423]66        setShowParam("feedtrans");
[401]67}
68
[423]69function ShowParams_energy_nut_set()
[401]70{
[423]71        setShowParam("energy_nut");
[401]72}
73
[422]74function ShowParams_stress_set()
75{
[423]76        setShowParam("stress");
[422]77}
78
[444]79function ShowParams_visualize_set()
80{
81        setShowParam("visualize");
82}
83
[401]84~
85
[422]86prop:
[423]87id:feedrate
[422]88name:Feeding rate
[423]89type:d 0 2 1 ~Low~Medium~High
[401]90
91prop:
[423]92id:feedtrans
[422]93name:Energy transfer
[474]94type:d 0 2 1 ~0.05~0.125~0.25
[401]95
96prop:
[423]97id:energy_nut
[422]98name:Nutrient energy
99type:d 0 2 1 ~0.5~1.5~3
[401]100
101prop:
[422]102id:stress
103name:Stress
104type:d 0 1 1
[444]105
106prop:
107id:visualize
108name:Enhance visualization
109type:d 0 1 0
Note: See TracBrowser for help on using the repository browser.