myLogger.debug("dailyO2MolesProduced:" + dailyO2MolesProduced); myLogger.debug("dailyO2GramsProduced:" + dailyO2GramsProduced);
    private void growBiomass() {        float waterFraction = 0f;        float litersOfWaterProduced = 0f;        myLastTotalWetBiomass = myCurrentTotalWetBiomass;        myLastEdibleWetBiomass = myCurrentEdibleWetBiomass;        calculateAverageCO2Concentration();        if (!canopyClosed) {            myLogger.debug("getDaysOfGrowth() = " + getDaysOfGrowth()                    + " and myTimeTillCanopyClosure = "                    + myTimeTillCanopyClosure);            if ((getDaysOfGrowth() >= myTimeTillCanopyClosure) && (myAge > 1)) {                canopyClosed = true;                myLogger.debug("canopy closed");            } else                myTimeTillCanopyClosure = calculateTimeTillCanopyClosure();        }        calculatePPFFractionAbsorbed();        //Biomass Grown this tick        float molecularWeightOfCarbon = 12.011f; //g/mol        CQY = calculateCQY();        carbonUseEfficiency24 = getCarbonUseEfficiency24();        float dailyCarbonGain = calculateDailyCarbonGain();        if (myAge % 24 == 0)            myLogger.debug(getDaysOfGrowth() + "\t" + dailyCarbonGain);        totalCO2MolesConsumed += (dailyCarbonGain / 24f);        myLogger.debug("dailyCarbonGain: " + dailyCarbonGain);        float cropGrowthRate = molecularWeightOfCarbon                * (dailyCarbonGain / getBCF());        myLogger.debug("cropGrowthRate: " + cropGrowthRate);        myCurrentDryBiomass += (cropGrowthRate / 1000 / 24f                * myShelfImpl.getCropAreaUsed() * myProductionRate); //in                                                                     // kilograms                                                                     // per hour        myLogger.debug("myCurrentDryBiomass:" + myCurrentDryBiomass);        if (getDaysOfGrowth() > getTimeAtOrganFormation())            myCurrentEdibleDryBiomass += (cropGrowthRate / 1000 / 24f                    * myShelfImpl.getCropAreaUsed() * getProtectedFractionOfEdibleBiomass());        myCurrentWaterInsideEdibleBiomass = myCurrentEdibleDryBiomass                * getProtectedEdibleFreshBasisWaterContent()                / (1f - getProtectedEdibleFreshBasisWaterContent());        myCurrentEdibleWetBiomass = myCurrentWaterInsideEdibleBiomass                + myCurrentEdibleDryBiomass;        float myCurrentInedbileDryBiomass = myCurrentDryBiomass                - myCurrentEdibleDryBiomass;        myCurrentWaterInsideInedibleBiomass = myCurrentInedbileDryBiomass                * getProtectedInedibleFreshBasisWaterContent()                / (1f - getProtectedInedibleFreshBasisWaterContent());        float myCurrentInedibleWetBiomass = myCurrentWaterInsideInedibleBiomass                + myCurrentInedbileDryBiomass;        myCurrentTotalWetBiomass = myCurrentInedibleWetBiomass                + myCurrentEdibleWetBiomass;        myLogger.debug("myCurrentEdibleDryBiomass: "                + myCurrentEdibleDryBiomass);        //Water In        myWaterNeeded = calculateWaterUptake();        myWaterLevel = myShelfImpl.takeWater(myWaterNeeded);        consumedWaterBuffer.add(myWaterLevel);        myLogger.debug("myWaterNeeded: " + myWaterNeeded);        myLogger.debug("myWaterLevel: " + myWaterLevel);        if (myWaterNeeded == 0)            waterFraction = 1f;        else            waterFraction = myWaterLevel / myWaterNeeded;        if (waterFraction < 1f) {            myCurrentDryBiomass -= (1f - waterFraction)                    * (cropGrowthRate / 1000 / 24f * myShelfImpl                            .getCropAreaUsed());            if (getDaysOfGrowth() > getTimeAtOrganFormation())                myCurrentEdibleDryBiomass -= (1f - waterFraction)                        * (cropGrowthRate / 1000 / 24f                                * myShelfImpl.getCropAreaUsed() * getProtectedFractionOfEdibleBiomass());            myLogger.debug("myCurrentDryBiomass:" + myCurrentDryBiomass);            myLogger.debug("myCurrentEdibleDryBiomass:"                    + myCurrentEdibleDryBiomass);            myCurrentWaterInsideEdibleBiomass = myCurrentEdibleDryBiomass                    * getProtectedEdibleFreshBasisWaterContent()                    / (1f - getProtectedEdibleFreshBasisWaterContent());            myCurrentEdibleWetBiomass = myCurrentWaterInsideEdibleBiomass                    + myCurrentEdibleDryBiomass;            myCurrentWaterInsideInedibleBiomass = myCurrentInedbileDryBiomass                    * getProtectedInedibleFreshBasisWaterContent()                    / (1f - getProtectedInedibleFreshBasisWaterContent());            myCurrentInedibleWetBiomass = myCurrentWaterInsideInedibleBiomass                    + myCurrentInedbileDryBiomass;            myCurrentTotalWetBiomass = myCurrentInedibleWetBiomass                    + myCurrentEdibleWetBiomass;        }        //Breathe Air        float molesOfCO2ToInhale = 0f;        if (waterFraction < 1f)            molesOfCO2ToInhale = waterFraction * dailyCarbonGain                    * myShelfImpl.getCropAreaUsed() / 24f;        else            molesOfCO2ToInhale = dailyCarbonGain                    * myShelfImpl.getCropAreaUsed() / 24f;        myMolesOfCO2Inhaled = myShelfImpl.getBiomassPSImpl()                .getAirConsumerDefinition().getEnvironments()[0]                .getCO2Store().take(molesOfCO2ToInhale);        totalCO2GramsConsumed += myMolesOfCO2Inhaled * 44f;        myLogger.debug("totalCO2GramsConsumed:" + totalCO2GramsConsumed);        myShelfImpl.getBiomassPSImpl().addAirInputActualFlowRates(0,        		myMolesOfCO2Inhaled);        myLogger.debug("molesOfCO2ToInhale:" + molesOfCO2ToInhale);        //Exhale Air        float dailyO2MolesProduced = 0f;        if (waterFraction < 1f)            dailyO2MolesProduced = waterFraction * getOPF()                    * dailyCarbonGain * myShelfImpl.getCropAreaUsed();        else            dailyO2MolesProduced = getOPF() * dailyCarbonGain                    * myShelfImpl.getCropAreaUsed();        float dailyO2GramsProduced = dailyO2MolesProduced * 32f;        myLogger.debug("dailyO2MolesProduced:" + dailyO2MolesProduced);        myLogger.debug("dailyO2GramsProduced:" + dailyO2GramsProduced);        totalO2GramsProduced += (dailyO2GramsProduced / 24f);        myLogger.debug("totalO2GramsProduced:" + totalO2GramsProduced);        float O2Produced = dailyO2MolesProduced / 24f; //in mol of oxygen per        // hour        float O2Exhaled = myShelfImpl.getBiomassPSImpl()                .getAirProducerDefinition().getEnvironments()[0]                .getO2Store().add(O2Produced);        myShelfImpl.getBiomassPSImpl()                .addAirOutputActualFlowRates(0, O2Exhaled);        myLogger.debug("O2Produced: " + O2Produced);        //Water Vapor Produced        if (waterFraction < 1f)            litersOfWaterProduced = waterFraction                    * calculateDailyCanopyTranspirationRate() / 24f                    * myShelfImpl.getCropAreaUsed();        else            litersOfWaterProduced = calculateDailyCanopyTranspirationRate()                    / 24f * myShelfImpl.getCropAreaUsed();        totalWaterLitersTranspired += litersOfWaterProduced;        myLogger.debug("totalWaterLitersTranspired:"                + totalWaterLitersTranspired);        //consumedWaterBuffer.take(litersOfWaterProduced);        //1/1000 liters per milliter, 1 gram per millilters, 8.016 grams per        // mole        float molesOfWaterProduced = waterLitersToMoles(litersOfWaterProduced);        float molesOfWaterAdded = myShelfImpl.getBiomassPSImpl()                .getAirProducerDefinition().getEnvironments()[0]                .getVaporStore().add(molesOfWaterProduced);        myShelfImpl.getBiomassPSImpl().addAirOutputActualFlowRates(0,                molesOfWaterAdded);        myLogger.debug("litersOfWaterProduced:" + litersOfWaterProduced);        myLogger.debug("molesOfWaterProduced:" + molesOfWaterProduced);        myLogger.debug("molesOfWaterAdded:" + molesOfWaterAdded);        myLogger.debug("consumedWaterBuffer level:"                + consumedWaterBuffer.getLevel());    }