Changeset 502 for experiments


Ignore:
Timestamp:
05/04/16 23:51:02 (9 years ago)
Author:
oriona
Message:

Reticulopdia movement and energy transfer corrected.

File:
1 edited

Legend:

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

    r496 r502  
    155155        phase = "low";
    156156        nutrientSqrCm = 10;
    157         ExpProperties.foodperiod = 25920;
    158         ExpProperties.foodPeriodChange = 6;
     157        ExpProperties.foodperiod = 19200;
     158        ExpProperties.foodPeriodChange = 0;
    159159        ExpProperties.nutrientradius = micronsToFrams(10);
    160         ExpProperties.energy_nut = energyFromVolume(ExpProperties.nutrientradius,1);
     160        ExpProperties.energy_nut = 150 * energyFromVolume(ExpProperties.nutrientradius,1);
    161161        ExpProperties.nutrient_pop = Math.pow(framsToMicrons(World.wrldsiz)*0.0001,2)/nutrientSqrCm;
    162162        ExpProperties.ingestion = 0.25;
     
    365365        if (ExpProperties.visualize == 1)
    366366        {
    367                 var ret = Populations[2].add("//0\np:sh=3,sx=0.01,sy="+getZoneRange(cr,1)+",sz="+getZoneRange(cr,1)+",ry=1.57,vr="+curColor);
     367                var ret = Populations[2].add("//0\np:sh=1,sx=0.001,sy=0.001,sz=0.001\np:sh=3,sx=0.01,sy="+getZoneRange(cr,1)+",sz="+getZoneRange(cr,1)+",ry=1.57079633,vr="+curColor+"\nj:0, 1, sh=1");
    368368                cr.data->reticulopodiacreature = ret;
     369                ret.getMechPart(0).orient.set(o);
    369370                ret.moveAbs(cr.center_x-getZoneRange(cr,1), cr.center_y-getZoneRange(cr,1), cr.center_z-getZoneRange(cr,1));
    370371        }
     
    502503                if (moved==1)
    503504                {
     505                        moveReticulopodia(cr);
    504506                        return;
    505507                }
     
    522524        {
    523525                cr.localDrive = cr.data->lifeparams->dir;
     526        }
     527        moveReticulopodia(cr);
     528}
     529
     530function moveReticulopodia(cr)
     531{
     532        if (visualization(cr))
     533        {
     534                cr.data->reticulopodiacreature.moveAbs(cr.center_x-getZoneRange(cr,1), cr.center_y-getZoneRange(cr,1), cr.center_z-getZoneRange(cr,1));
     535                cr.data->reticulopodiacreature.localDrive = cr.localDrive;
    524536        }
    525537}
     
    536548{
    537549        cr1.localDrive = XYZ.new(0,0,0);
    538         var e =  ExpProperties.feedtrans*cr1.energy;//ExpProperties.feedtrans*cr1.energy*ExpProperties.ingestion*ExpProperties.secPerStep; //TODO efficiency dependent on age
    539         e = Math.min(cr2.energy, e);
    540         e *= ExpProperties.secPerStep;
    541         //Simulator.print("transferring "+e +"("+e*ExpProperties.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.name+" ("+cr2.energy+") "+ e/ExpProperties.secPerStep+ " per sec");
    542         cr2.energy_m = cr2.energy_m + e + 0.0000001;
    543         cr1.energy_p = cr1.energy_p + e*ExpProperties.ingestion;
     550        var e =  ExpProperties.feedtrans*cr1.energy; //TODO efficiency dependent on age
     551        e = Math.min(cr2.energy, e*ExpProperties.secPerStep);
     552        //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_p += e*ExpProperties.ingestion;
    544555        if (cr1.data->lifeparams->hibernated == 1)
    545556        {
     
    628639                foramMove(cr);
    629640
    630                 if (visualization(cr))
    631 
    632                 {
    633                         cr.data->reticulopodiacreature.moveAbs(cr.center_x-getZoneRange(cr,1), cr.center_y-getZoneRange(cr,1), cr.center_z-getZoneRange(cr,1));
    634                 }
    635 
    636641                var repro = foramReproduce(cr);
    637642                if (repro == 1)
     
    683688function createNutrientGenotype(nutrientradius)
    684689{
    685         return "//0\np:sh=3,sx="+nutrientradius+",sy="+nutrientradius+",sz="+nutrientradius+",ry=1.5,vr=0.0,1.0,0.0";
     690        return "//0\np:sh=3,sx="+nutrientradius+",sy="+nutrientradius+",sz="+nutrientradius+",ry=1.57,vr=0.0,1.0,0.0";
    686691}
    687692
Note: See TracChangeset for help on using the changeset viewer.