Skip to content
Snippets Groups Projects
Commit 1d40a5db authored by Brutzman, Don's avatar Brutzman, Don
Browse files

javadoc

parent 223755a8
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment