/** * Copyright (c) 2008-2023, MOVES Institute, Naval Postgraduate School (NPS). All rights reserved. * This work is provided under a BSD open-source license, see project license.html and license.txt */ package MV3500Cohort2023MarchJune.projects.Islas; /** Model of interest */ public class LivestockRanch { private int totalCattle; private int totalPigs; private int totalBroilerChickens; private int totalLayerChickens; private double cattleProcessRate; private double pigProcessRate; private double chickenProcessRate; private double eggLayingRate; /** Constructor */ public LivestockRanch (int totalCattle, int totalPigs, int totalBroilerChickens, int totalLayerChickens) { this.totalCattle = totalCattle; this.totalPigs = totalPigs; this.totalBroilerChickens = totalBroilerChickens; this.totalLayerChickens = totalLayerChickens; this.cattleProcessRate = totalCattle * 500 / (3 * 12); // Processing 1/3 of the total population per year, 1 per month, at 500 lbs of beef per cow this.pigProcessRate = totalPigs * 150 / 6; // Processing 1/6 of the total population per month, at 150 lbs of pork per pig this.chickenProcessRate = totalBroilerChickens * 6 / 3; // Processing 1/3 of the total population per month, at 6 lbs per chicken this.eggLayingRate = totalLayerChickens * (25 / 12); // 25 eggs per layer chicken (divided by 12 to be sold in dozens) } /** accessor */ public int getTotalCattle() { return totalCattle; } /** accessor */ public int getTotalPigs() { return totalPigs; } /** accessor */ public int getTotalBroilerChickens() { return totalBroilerChickens; } /** accessor */ public int getTotalLayerChickens() { return totalLayerChickens; } /** Javadoc goes here */ public double getCattleProcessRate() { return cattleProcessRate; } /** accessor */ public double getPigProcessRate() { return pigProcessRate; } /** accessor */ public double getChickenProcessRate() { return chickenProcessRate; } /** accessor */ public double getEggLayingRate() { return eggLayingRate; } }