diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java index 6a62efa52970ecca174cf5b3a801cefab4af4e94..b8830684a8bd6a7d658b0db8db4e32ad52449fb5 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java @@ -7,7 +7,12 @@ package MV3500Cohort2023MarchJune.projects.Islas; import java.io.*; import java.net.*; +/** Model */ public class Client_Farm { + + /** Command line interface invocation + * @param args arguments + */ public static void main(String[] args) { // TODO - Fill out the following questionairre: diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java index 135e7d8b3510834bf271aa6590c627a2c10c2948..8917091776d9c6f5335748de8b39418c74c4ab5c 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java @@ -8,12 +8,15 @@ import simkit.SimEntityBase; import simkit.random.RandomVariate; import simkit.random.RandomVariateFactory; +/** Model */ public class Customer extends SimEntityBase{ + private RandomVariate beefPreference; private RandomVariate porkPreference; private RandomVariate chickenPreference; private RandomVariate eggsPreference; + /** Constructor */ public Customer(double averagePurchaseOfBeef, double beefPlusMinus, double averagePurchaseOfPork, double porkPlusMinus, double averagePurchaseOfChicken, double chickenPlusMinus, double averagePurchaseOfEggs, double eggsPlusMinus) { this.beefPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfBeef, beefPlusMinus); this.porkPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfPork, porkPlusMinus); @@ -21,10 +24,12 @@ public class Customer extends SimEntityBase{ this.eggsPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfEggs, eggsPlusMinus); } + /** commence simulation run */ public void doRun() { waitDelay("Transaction", 0.0); } + /** perform transaction */ public void doTransaction() { double beef = beefPreference.generate(); beef = beef < 0 ? 0 : beef; @@ -42,18 +47,26 @@ public class Customer extends SimEntityBase{ waitDelay("Transaction", 7.0); } + /** accessor + * @return preference RandomVariate */ public RandomVariate getBeefPreference() { return beefPreference; } + /** accessor + * @return preference RandomVariate */ public RandomVariate getPorkPreference() { return porkPreference; } + /** accessor + * @return preference RandomVariate */ public RandomVariate getChickenPreference() { return chickenPreference; } + /** accessor + * @return preference RandomVariate */ public RandomVariate getEggsPreference() { return eggsPreference; } diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java index a671770146c2553106c99a211d0058c2ea6f557f..bd4eea96f3888a3595016657378a80cfedf970e9 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java @@ -6,6 +6,7 @@ package MV3500Cohort2023MarchJune.projects.Islas; import java.text.DecimalFormat; +/** Model */ public class FarmStore { private double bankAccount; private double BEEFCOST = 10; // Cost per pound @@ -18,6 +19,7 @@ public class FarmStore { protected double chickenQuantity; // Quantity in pounds protected double eggQuantity; // Quantity in dozens + /** Constructor */ public FarmStore() { this.bankAccount = 0; this.beefQuantity = 0; @@ -26,6 +28,12 @@ public class FarmStore { this.eggQuantity = 0; } + /** perform transaction + * @param beef additions + * @param pork additions + * @param chicken additions + * @param eggs additions + * @return receipt message */ public String doTransaction(double beef, double pork, double chicken, double eggs) { DecimalFormat df = new DecimalFormat("#.##"); @@ -62,6 +70,12 @@ public class FarmStore { return "Product purchased:\nBeef: " + beef + " lbs\nPork: " + pork + " lbs\nChicken: " + chicken + " lbs\nEggs: " + eggs + " dozen\nTransaction total: $" + cost; } + /** Simulation step + * @param beef additions + * @param pork additions + * @param chicken additions + * @param eggs additions + * @return receipt message */ public String doResupply(double beef, double pork, double chicken, double eggs) { this.beefQuantity += beef; this.porkQuantity += pork; diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java index d22d3d6dcfba261698e9148b939188fee5616b6c..5da3bf06bf51bba6deadead1bca6503a3ebf78bf 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java @@ -4,6 +4,7 @@ */ package MV3500Cohort2023MarchJune.projects.Islas; +/** Model of interest */ public class LivestockRanch { private int totalCattle; private int totalPigs; @@ -15,6 +16,7 @@ public class LivestockRanch { private double chickenProcessRate; private double eggLayingRate; + /** Constructor */ public LivestockRanch (int totalCattle, int totalPigs, int totalBroilerChickens, int totalLayerChickens) { this.totalCattle = totalCattle; this.totalPigs = totalPigs; @@ -27,34 +29,42 @@ public class LivestockRanch { 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; }