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

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

Chamber growth visualization added, [OFFSPRING] message added, refactoring.

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