/// <summary> /// Maintenance energy requirement. /// Energy required to maintain this prawns weight /// </summary> /// <param name="Prawns"></param> /// <param name="StressTemp"></param> /// <param name="StressSalinity"></param> /// <returns>(kJ/prawn/d)</returns> private double EnergyMaintenance(PrawnCohort Prawns, double StressTemp, double StressSalinity) { double energy; energy = Km1 * Math.Pow(Prawns.LiveWeight, Km2); energy = energy * StressTemp * StressSalinity; return(energy); }
/// <summary> /// Calculate todays potential total consumption of Dry Matter (per prawn). /// Function was derived by reverse-engineering the prawn growth rate equation of Jackson and Yang (1998). /// Which is why we first calculate intake, then work out what the consumption must have been. /// </summary> /// <param name="Prawns"></param> /// <param name="StressStock"></param> /// <param name="StressTemp"></param> /// <returns>(g DM/prawn/d</returns> private double PotentialDMConsumedPerPrawn(PrawnCohort Prawns, double StressStock, double StressTemp) { double intake, consumed; intake = Ki1 * Math.Pow(Prawns.LiveWeight, Ki2); intake = intake * StressStock * stressTemp; consumed = (1 / Ki4) * intake; //invert consumption efficiency to go back the other way. return(consumed); }
private Feed FeedIntake(PrawnCohort Prawns, Feed IntakeFeedPP) { double dm, n, de; dm = IntakeFeedPP.DryMatter * Prawns.NumberOfPrawns * g2kg; n = IntakeFeedPP.Nitrogen * Prawns.NumberOfPrawns * g2kg; de = IntakeFeedPP.DigestibleEnergy * Prawns.NumberOfPrawns; Feed intake = new Feed(IntakeFeedPP.FeedName, dm, n, de); return(intake); }
private Feed FeedDigested(PrawnCohort Prawns, Feed DigestedFeedPP) { double dm, n, de; dm = DigestedFeedPP.DryMatter * Prawns.NumberOfPrawns * g2kg; n = DigestedFeedPP.Nitrogen * Prawns.NumberOfPrawns * g2kg; de = DigestedFeedPP.DigestibleEnergy * Prawns.NumberOfPrawns; Feed digested = new Feed(DigestedFeedPP.FeedName, dm, n, de); return(digested); }
/// <summary> /// Return the prawns that died today as a feed type to add back into the pond. /// </summary> /// <param name="Deaths">Number of prawns that died today</param> /// <param name="Prawns">Current Prawns that are in the pond</param> /// <returns>Feed to be added to the pond</returns> private Feed DeadPrawnsAsFeed(int Deaths, PrawnCohort Prawns) { double Kdm = 0.26; //dry matter content of prawns double de2dm = 16; //a reasonable guess. double dm, n, de; dm = Kdm * Deaths * (Prawns.LiveWeight * g2kg); n = Deaths * (Prawns.NitrogenMass * g2kg); de = de2dm * dm; Feed deadPrawnsAsFeed = new Feed("DeadPrawns", dm, n, de); return(deadPrawnsAsFeed); }
/// <summary> /// Number of prawns that died today. /// Background deaths (approximately equivalent to 20% per year) /// plus additional deaths due low salinity and high ammonium. /// (using an equation fitted to the data of Li et al 2007) /// </summary> /// <param name="Prawns">Current Prawns</param> /// <param name="Salinity">Salinity (ppt)</param> /// <param name="Ammonium">Ammonium (mg/litre)</param> /// <returns>(prawns/d)</returns> private int Mortality(PrawnCohort Prawns, double Salinity, double Ammonium) { double background = Kd1; double lowSalinity = MathUtilities.Divide(Salinity, Kd3, 0.0); lowSalinity = 1.0 - lowSalinity; lowSalinity = Math.Max(0, lowSalinity); double highAmmonium = MathUtilities.Divide(Ammonium, Kd4, 0.0); highAmmonium = highAmmonium - 1.0; highAmmonium = Math.Max(0, highAmmonium); highAmmonium = Math.Pow(highAmmonium, Kd5); double additional = Kd2 * lowSalinity * highAmmonium; double deathRate = background + additional; double deadPrawnNumber = Prawns.NumberOfPrawns * (1.0 - Math.Exp(-deathRate)); return((int)deadPrawnNumber); }
/// <summary> /// Restricts the Potential total amount of DM Consumed (per prawn) by what is actually available in the pond to be consumed. /// </summary> /// <param name="FoodAvailable">Food that is currently in the pond</param> /// <param name="Prawns">Prawns that are currently in the pond</param> /// <param name="PotentialDMConsumedPP">Amount of DM each prawn would like to eat</param> /// <returns>Amount of DM each prawn will actually get to eat. (g DM/prawn)</returns> private double CheckEnoughFoodToConsumeToday(Food FoodAvailable, PrawnCohort Prawns, double PotentialDMConsumedPP) { double potDMConsumed_kg = PotentialDMConsumedPP * Prawns.NumberOfPrawns * g2kg; //convert from grams to kg. //Check there is any food in the pond. if ((FoodAvailable.TotalDM <= 0.0) && (Prawns.NumberOfPrawns > 0)) { Summary.WriteWarning(this, "There is no food in the pond. The prawns are starving"); return(0.0); } //Check there is enough food in the pond if (potDMConsumed_kg > FoodAvailable.TotalDM) { Summary.WriteWarning(this, "Not enough food in pond for prawns to eat today." + Environment.NewLine + "Reducing dry matter consumed from " + Math.Round(potDMConsumed_kg, 3) + " (kg) to " + Math.Round(FoodAvailable.TotalDM, 3) + " (kg)"); //just give them what is there return(MathUtilities.Divide(FoodAvailable.TotalDM, Prawns.NumberOfPrawns, 0.0) * kg2g); //convert kg to grams } return(PotentialDMConsumedPP); }
/// <summary> /// Calculate todays potential total consumption of Dry Matter (per prawn). /// Function was derived by reverse-engineering the prawn growth rate equation of Jackson and Yang (1998). /// Which is why we first calculate intake, then work out what the consumption must have been. /// </summary> /// <param name="Prawns"></param> /// <param name="StressStock"></param> /// <param name="StressTemp"></param> /// <returns>(g DM/prawn/d</returns> private double PotentialDMConsumedPerPrawn(PrawnCohort Prawns, double StressStock, double StressTemp) { double intake, consumed; intake = Ki1 * Math.Pow(Prawns.LiveWeight, Ki2); intake = intake * StressStock * stressTemp; consumed = (1 / Ki4) * intake; //invert consumption efficiency to go back the other way. return consumed; }
/// <summary> /// Restricts the Potential total amount of DM Consumed (per prawn) by what is actually available in the pond to be consumed. /// </summary> /// <param name="FoodAvailable">Food that is currently in the pond</param> /// <param name="Prawns">Prawns that are currently in the pond</param> /// <param name="PotentialDMConsumedPP">Amount of DM each prawn would like to eat</param> /// <returns>Amount of DM each prawn will actually get to eat. (g DM/prawn)</returns> private double CheckEnoughFoodToConsumeToday(Food FoodAvailable, PrawnCohort Prawns, double PotentialDMConsumedPP) { double potDMConsumed_kg = PotentialDMConsumedPP * Prawns.NumberOfPrawns * g2kg; //convert from grams to kg. //Check there is any food in the pond. if ((FoodAvailable.TotalDM <= 0.0) && (Prawns.NumberOfPrawns > 0)) { Summary.WriteWarning(this, "There is no food in the pond. The prawns are starving"); return 0.0; } //Check there is enough food in the pond if (potDMConsumed_kg > FoodAvailable.TotalDM) { Summary.WriteWarning(this, "Not enough food in pond for prawns to eat today." + Environment.NewLine + "Reducing dry matter consumed from " + Math.Round(potDMConsumed_kg,3) + " (kg) to " + Math.Round(FoodAvailable.TotalDM, 3) + " (kg)"); //just give them what is there return MathUtilities.Divide(FoodAvailable.TotalDM, Prawns.NumberOfPrawns, 0.0) * kg2g; //convert kg to grams } return PotentialDMConsumedPP; }
/// <summary> /// Harvest the Pond of Prawns. /// All prawns are removed from the pond. /// </summary> public void HarvestPond() { prawns = new PrawnCohort(0, 0.0, 0.0); }
/// <summary> /// Return the prawns that died today as a feed type to add back into the pond. /// </summary> /// <param name="Deaths">Number of prawns that died today</param> /// <param name="Prawns">Current Prawns that are in the pond</param> /// <returns>Feed to be added to the pond</returns> private Feed DeadPrawnsAsFeed(int Deaths, PrawnCohort Prawns) { double Kdm = 0.26; //dry matter content of prawns double de2dm = 16; //a reasonable guess. double dm, n, de; dm = Kdm * Deaths * (Prawns.LiveWeight * g2kg); n = Deaths * (Prawns.NitrogenMass * g2kg); de = de2dm * dm; Feed deadPrawnsAsFeed = new Feed("DeadPrawns", dm, n, de); return deadPrawnsAsFeed; }
/// <summary> /// Harvest the Pond of Prawns. /// All prawns are removed from the pond. /// </summary> public void HarvestPond() { prawns = new PrawnCohort(0, 0.0, 0.0); }
/// <summary> /// Add Prawns to the Pond. /// Any existing prawns in the pond are removed first. /// </summary> /// <param name="NumberOfPrawns"></param> /// <param name="LiveWeight">(g/prawn)</param> /// <param name="NitrogenMass">(g N/prawn)</param> public void AddPrawnsToPond(int NumberOfPrawns, double LiveWeight, double NitrogenMass) { prawns = new PrawnCohort(NumberOfPrawns, LiveWeight, NitrogenMass); }
/// <summary> /// Maintenance energy requirement. /// Energy required to maintain this prawns weight /// </summary> /// <param name="Prawns"></param> /// <param name="StressTemp"></param> /// <param name="StressSalinity"></param> /// <returns>(kJ/prawn/d)</returns> private double EnergyMaintenance(PrawnCohort Prawns, double StressTemp, double StressSalinity) { double energy; energy = Km1 * Math.Pow(Prawns.LiveWeight, Km2); energy = energy * StressTemp * StressSalinity; return energy; }
private void OnStartOfSimulation(object sender, EventArgs e) { prawns = new PrawnCohort(0, 0.0, 0.0); }
/// <summary> /// Number of prawns that died today. /// Background deaths (approximately equivalent to 20% per year) /// plus additional deaths due low salinity and high ammonium. /// (using an equation fitted to the data of Li et al 2007) /// </summary> /// <param name="Prawns">Current Prawns</param> /// <param name="Salinity">Salinity (ppt)</param> /// <param name="Ammonium">Ammonium (mg/litre)</param> /// <returns>(prawns/d)</returns> private int Mortality(PrawnCohort Prawns, double Salinity, double Ammonium) { double background = Kd1; double lowSalinity = MathUtilities.Divide(Salinity, Kd3, 0.0); lowSalinity = 1.0 - lowSalinity; lowSalinity = Math.Max(0, lowSalinity); double highAmmonium = MathUtilities.Divide(Ammonium, Kd4, 0.0); highAmmonium = highAmmonium - 1.0; highAmmonium = Math.Max(0, highAmmonium); highAmmonium = Math.Pow(highAmmonium, Kd5); double additional = Kd2 * lowSalinity * highAmmonium; double deathRate = background + additional; double deadPrawnNumber = Prawns.NumberOfPrawns * (1.0 - Math.Exp(-deathRate)); return (int)deadPrawnNumber; }
private Feed FeedIntake(PrawnCohort Prawns, Feed IntakeFeedPP) { double dm, n, de; dm = IntakeFeedPP.DryMatter * Prawns.NumberOfPrawns * g2kg; n = IntakeFeedPP.Nitrogen * Prawns.NumberOfPrawns * g2kg; de = IntakeFeedPP.DigestibleEnergy * Prawns.NumberOfPrawns; Feed intake = new Feed(IntakeFeedPP.FeedName, dm, n, de); return intake; }
private Feed FeedDigested(PrawnCohort Prawns, Feed DigestedFeedPP) { double dm, n, de; dm = DigestedFeedPP.DryMatter * Prawns.NumberOfPrawns * g2kg; n = DigestedFeedPP.Nitrogen * Prawns.NumberOfPrawns * g2kg; de = DigestedFeedPP.DigestibleEnergy * Prawns.NumberOfPrawns; Feed digested = new Feed(DigestedFeedPP.FeedName, dm, n, de); return digested; }
private void OnStartOfSimulation(object sender, EventArgs e) { prawns = new PrawnCohort(0, 0.0, 0.0); }
/// <summary> /// Add Prawns to the Pond. /// Any existing prawns in the pond are removed first. /// </summary> /// <param name="NumberOfPrawns"></param> /// <param name="LiveWeight">(g/prawn)</param> /// <param name="NitrogenMass">(g N/prawn)</param> public void AddPrawnsToPond(int NumberOfPrawns, double LiveWeight, double NitrogenMass) { prawns = new PrawnCohort(NumberOfPrawns, LiveWeight, NitrogenMass); }