Changeset 475


Ignore:
Timestamp:
03/13/16 01:20:30 (9 years ago)
Author:
oriona
Message:

Energy calculated as a volume of the sphere. Energy usage calculated as a percent of current energy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experiments/frams/foraminifera/data/scripts/foraminifera.expdef

    r474 r475  
    8484        //time
    8585        ExpParams.secPerStep = 60;
    86         ExpParams.foramSpeedMmPerMin = 0.1;
     86        ExpParams.foramSpeedMmPerMin = 0.05;
    8787        movePerStep = getMovePerStep();
    8888
     
    100100        //morphology
    101101        dir_change = 30000;
    102         ExpParams.zone1_range = micronsToFrams(3000);
    103         ExpParams.zone2_range = micronsToFrams(6000);
     102        ExpParams.zone1_range = micronsToFrams(1000);
     103        ExpParams.zone2_range = micronsToFrams(3000);
    104104        init_chambers();
    105105        ExpParams.chamber_proculus_haplo = micronsToFrams(50);
     
    112112                for (var i = 0; i < chambers[0].size; i++)
    113113                {
    114                         max_chamber_energ[j].add(((Math.pow(getProperty(j, "chamber_proculus"),3) + Math.pow(getProperty(j, "chamber_proculus") + (i) * getProperty(j, "chamber_difference"),3))*(i+1))/2);
     114                        max_chamber_energ[j].add(((energyFromVolume(getProperty(j, "chamber_proculus")) + energyFromVolume(getProperty(j, "chamber_proculus") + (i) * getProperty(j, "chamber_difference")))*(i+1))/2);
    115115                }                                 
    116116        }
     
    132132        //nutrients
    133133        ExpParams.nutrientsize = micronsToFrams(10);
    134         ExpParams.energy_nut = 100 * Math.pow(ExpParams.nutrientsize, 3);
     134        ExpParams.energy_nut = 100 * energyFromVolume(ExpParams.nutrientsize);
    135135        ExpParams.nutrientPop = 1;
    136136        ExpParams.feedrate = 100;
     
    141141
    142142@include "standard_placement.inc"
     143
     144function energyFromVolume(radius)
     145{
     146        return 4.0/3.0*Math.pi*Math.pow(radius,3);
     147}
    143148
    144149function getMovePerStep()
     
    258263function setForamMeta(cr, gen)
    259264{
    260         cr.idleen = (ExpParams.e_meta * max_chamber_energ[gen][Math.min(lastChamberNum(cr), max_chamber_energ[gen].size-1)])*ExpParams.secPerStep;
     265        //cr.idleen = (ExpParams.e_meta * max_chamber_energ[gen][Math.min(lastChamberNum(cr), max_chamber_energ[gen].size-1)])*ExpParams.secPerStep;
     266        cr.idleen = (ExpParams.e_meta * cr.energy)*ExpParams.secPerStep;
    261267}
    262268
     
    384390        if (cr.user2["hibernated"] == 0)
    385391        {
    386                 cr.energy_m += (ExpParams.energy_move * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)])*ExpParams.secPerStep;
     392                //cr.energy_m += (ExpParams.energy_move * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)])*ExpParams.secPerStep;
     393                cr.energy_m += (ExpParams.energy_move * cr.energy)*ExpParams.secPerStep;
    387394        }
    388395}
     
    457464        else
    458465        {
    459                 cr.idleen = (ExpParams.energy_hib * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)])*ExpParams.secPerStep; //hibernate
     466                //cr.idleen = (ExpParams.energy_hib * max_chamber_energ[cr.user2["gen"]][Math.min(lastChamberNum(cr), (max_chamber_energ[cr.user2["gen"]].size)-1)])*ExpParams.secPerStep; //hibernate
     467                cr.idleen = (ExpParams.energy_hib * cr.energy)*ExpParams.secPerStep; //hibernate
    460468        }
    461469        cr.user2["hibernated"] = 1 - cr.user2["hibernated"];
     
    496504function deathConditions(cr)
    497505{
    498         if ((cr.energy <= ExpParams.e_death_level) || (Math.rnd01 < ExpParams.hunted_prob))
     506        if ((cr.energy <= getProperty(cr.user2["species"],"e_death_level")) || (Math.rnd01 < ExpParams.hunted_prob))
    499507                return 1;
    500508        else
     
    781789
    782790prop:
     791id:e_death_level_haplo
     792name:Minimal level of energy to sustain life of haploid
     793type:f 0 20 4
     794group:Foraminifera
     795
     796prop:
     797id:e_death_level_diplo
     798name:Minimal level of energy to sustain life of diploid
     799type:f 0 20 0.25
     800group:Foraminifera
     801
     802prop:
    783803id:energy_hib
    784804name:Energy used for hibernation during one step
     
    820840name:Mutation probability
    821841type:f 0 1 0
    822 group:Foraminifera
    823 
    824 prop:
    825 id:e_death_level
    826 name:Minimal level of energy to sustain life
    827 type:f 0 20 0
    828842group:Foraminifera
    829843
Note: See TracChangeset for help on using the changeset viewer.