Skip to content

Commit

Permalink
Merge pull request #902 from her123/master
Browse files Browse the repository at this point in the history
Stock component with test feed lot simulation
  • Loading branch information
hol353 authored Jun 24, 2016
2 parents 12f88a8 + b0077df commit bb486a0
Show file tree
Hide file tree
Showing 5 changed files with 37,749 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Models/Grazplan/Supplement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ public StoreType[] stores
result[i].EEConc = theModel[i].EtherExtract;
result[i].ADIP2CP = theModel[i].ADIP_2_CP;
result[i].AshAlk = theModel[i].AshAlkalinity;
result[i].MaxPassage = theModel[i].AshAlkalinity;
result[i].MaxPassage = theModel[i].MaxPassage;
}
return result;
}
Expand Down Expand Up @@ -931,7 +931,7 @@ public SuppToStockType[] SuppToStock
result[i].EEConc = supp.EtherExtract;
result[i].ADIP2CP = supp.ADIP_2_CP;
result[i].AshAlk = supp.AshAlkalinity;
result[i].MaxPassage = supp.AshAlkalinity;
result[i].MaxPassage = supp.MaxPassage;
}
return result;
}
Expand Down Expand Up @@ -966,7 +966,7 @@ public StoreType this[string suppName]
result.EEConc = theModel[i].EtherExtract;
result.ADIP2CP = theModel[i].ADIP_2_CP;
result.AshAlk = theModel[i].AshAlkalinity;
result.MaxPassage = theModel[i].AshAlkalinity;
result.MaxPassage = theModel[i].MaxPassage;
return result;
}
}
Expand Down
8 changes: 5 additions & 3 deletions Models/Stock/stock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public int[] Number
{
get
{
int[] numbers = new int[FModel.Count()];
int[] numbers = new int[FModel.Count()];
StockVars.PopulateNumberValue(FModel, StockVars.CountType.eBoth, false, false, false, ref numbers);
return numbers;
}
Expand Down Expand Up @@ -565,7 +565,7 @@ public string[] Sex

// =========== Ages ==================
/// <summary>
/// Age of animals by group
/// Age of animals by group.
/// </summary>
[Description("Age of animals by group")]
[Units("d")]
Expand Down Expand Up @@ -3841,6 +3841,8 @@ private void OnStartOfDay(object sender, EventArgs e)

FFirstStep = false;
}

GetTimeAndWeather();
}

/// <summary>
Expand All @@ -3861,7 +3863,7 @@ private void OnEndOfDay(object sender, EventArgs e)
[EventSubscribe("DoStock")]
private void OnDoStock(object sender, EventArgs e)
{
GetTimeAndWeather();
// Weather is retrieved at StartOfDay

// for each paddock
//FModel.Paddocks.byID(1).fWaterlog = 0.0; // TODO
Expand Down
4 changes: 2 additions & 2 deletions Models/Stock/stock_vars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ public static bool PopulateNumberValue(TStockList Model, CountType code, bool bU
}

/// <summary>
/// Fill the double[] with values from the model
/// Fill the double[] with values from the model.
/// </summary>
/// <param name="Model"></param>
/// <param name="varCode"></param>
Expand Down Expand Up @@ -828,7 +828,7 @@ public static bool PopulateRealValue(TStockList Model, int varCode, bool bUseYou
if (!bUseTag && !bUseAll)
aValue[Idx - 1] = dValue;
else if (varCode == StockProps.prpDSE) // Sum DSE's; take a weighted average of
dTotal = dTotal + dValue; // all other values
dTotal = dTotal + dValue; // all other values
else if (aGroup != null)
{
dTotal = dTotal + aGroup.NoAnimals * dValue;
Expand Down
Loading

0 comments on commit bb486a0

Please sign in to comment.