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

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

Chamber growth visualization time extended. Nutrient energy corrected.

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