Ignore:
Timestamp:
05/19/16 23:30:23 (9 years ago)
Author:
oriona
Message:

Energy transfer changed for using tranferEnergyTo function. Dilpoid offspring number calculation changed.

Location:
experiments/frams/foraminifera/data/scripts
Files:
2 edited

Legend:

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

    r506 r510  
    548548{
    549549        cr1.localDrive = XYZ.new(0,0,0);
    550         var e =  ExpProperties.feedtrans*cr1.energy; //TODO efficiency dependent on age
    551         e = Math.min(cr2.energy, e*ExpProperties.secPerStep);
     550        var e =  ExpProperties.feedtrans*cr1.energy*ExpProperties.secPerStep; //TODO efficiency dependent on age
    552551        //Simulator.print("transferring "+e +"("+e*ExpProperties.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.uid+" ("+cr2.energy+") "+ e/ExpProperties.secPerStep+ " per sec");
    553         cr2.energy -= (e + 0.0000001);
    554         cr1.energy += e*ExpProperties.ingestion;
     552        var transferred = cr2.transferEnergyTo(cr1, e);
     553        cr1.energy -= transferred*(1-ExpProperties.ingestion);
    555554        if (cr1.data->lifeparams->hibernated == 1)
    556555        {
  • experiments/frams/foraminifera/data/scripts/foraminifera.inc

    r496 r510  
    126126function reproduce_diploid(parent)
    127127{
    128         var energy0 =getEnergy0( getGene(parent,"energies0", 0)[0]);
    129         var number = ((1 - (getProperty(parent.data->lifeparams->gen, "e_repro_cost"))) * parent.energy) / energy0;
     128        var offspring = gametsDivision(parent.energy,getEnergy0(getGene(parent,"energies0", 0)[0]));
     129        var energy0 = offspring->energy;
     130        var number = offspring->number;
    130131
    131132                if (ExpProperties.logging == 1)
Note: See TracChangeset for help on using the changeset viewer.