Documentation ¶
Overview ¶
background
Copyright 2021 Bruce Golden and Matt Spangler ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
fatCattle
Copyright 2021 Bruce Golden and Matt Spangler ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
initIndexParams
Copyright 2021 Bruce Golden and Matt Spangler ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
slaughterCattle
weaning
Copyright 2021 Bruce Golden and Matt Spangler ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func CowCosts(nYears int) float64
- func CowsToHeifers()
- func EvaluateBackgroundingIndex(nYears int, burninMarker int, param map[string]interface{}, ...) float64
- func EvaluateFatCattleIndex(nYears int, burninMarker int, param map[string]interface{}, ...) float64
- func EvaluateSlaughterCattleIndex(nYears int, burninMarker int, param map[string]interface{}, ...) float64
- func EvaluateWeaningIndex(nYears int, burninMarker int, param map[string]interface{}, ...) float64
- func InitGrid()
- func InitIndexParams(indexParam *string)
- func IsInIndex(b animal.Component_t) bool
- func IsIndexTerminal() bool
- func LoadIndexComponents()
- func ProcessNetReturns(indexParam *string, nYears int, burninMarker int, param map[string]interface{}, ...)
- func SetActiveCowList()
- func WeaningNetReturnsToFixedCosts(nYears int) float64
- func WeaningVariableCostsPerMating(nYears int) float64
- func WhatSaleEndpoint() (indexType string)
- type GridValue_t
- type TraitSexMinWtMaxWt_t
Constants ¶
This section is empty.
Variables ¶
var AumCost []float64
var BackgroundAumCost []float64
var BackgroundDays float64 // length of the backgrounding program after weaning
var DiscountRate float64
var FeedlotFeedCost float64
var InProgramProportion float64 // proportion of calves that initially may qualify for a grid program - e.g., CHB, CAB
var IndexComponents []animal.Component_t
var IndexTerminal bool
var IndexType string
var NetReturns float64
var ParamIndex map[string]interface{}
setup the map of the array of json name:value pairs - notice "interface{}"
var PriceTable []TraitSexMinWtMaxWt_t
var StartYearOfNetReturns int
Functions ¶
func EvaluateBackgroundingIndex ¶
func EvaluateBackgroundingIndex(nYears int, burninMarker int, param map[string]interface{}, gvCholesky mat.Cholesky, rvCholesky mat.Cholesky) float64
Process an index with sale at after backgrounding
func EvaluateFatCattleIndex ¶
func EvaluateFatCattleIndex(nYears int, burninMarker int, param map[string]interface{}, gvCholesky mat.Cholesky, rvCholesky mat.Cholesky) float64
Process an index with sale as finished cattle
func EvaluateSlaughterCattleIndex ¶
func EvaluateSlaughterCattleIndex(nYears int, burninMarker int, param map[string]interface{}, gvCholesky mat.Cholesky, rvCholesky mat.Cholesky) float64
Process an index with sale as finished cattle
func EvaluateWeaningIndex ¶
func EvaluateWeaningIndex(nYears int, burninMarker int, param map[string]interface{}, gvCholesky mat.Cholesky, rvCholesky mat.Cholesky) float64
Process an index with sale at weaning
func IsIndexTerminal ¶
func IsIndexTerminal() bool
func ProcessNetReturns ¶
func ProcessNetReturns(indexParam *string, nYears int, burninMarker int, param map[string]interface{}, gvCholesky mat.Cholesky, rvCholesky mat.Cholesky)
main call
func SetActiveCowList ¶
func SetActiveCowList()
// Reset Records back to heifers
func HeiferReset() { for i := range animal.HeiferResetList { animal.Records[i].Sex = animal.Heifer animal.Records[i].BreedingRecords = nil animal.Records[i].Dead = 0 animal.Records[i].YearCowCulled = 0 animal.Records[i].Active = false } }
// Reset Records back to active cows
func CowReset() { for l := range animal.CowResetList { i := animal.CowResetList[l].Id - 1 animal.Records[i].Sex = animal.Cow animal.Records[i].BreedingRecords = nil animal.Records[i].Dead = 0 animal.Records[i].YearCowCulled = 0 animal.Records[i].Active = true animal.Records[i].BreedingRecords = animal.CowResetList[l].BreedingRecords } }
func WeaningNetReturnsToFixedCosts ¶
The total discounted net returns to fixed costs for weaning
and optionally write a table to stdout Returns average cost/mating
func WeaningVariableCostsPerMating ¶
This is used to caalculate the weaning costs per year for all indexes except weaning, because weaning does it below in the net returns calculation.
func WhatSaleEndpoint ¶
func WhatSaleEndpoint() (indexType string)
Return the type of index the hjson builds
Types ¶
type GridValue_t ¶
type TraitSexMinWtMaxWt_t ¶
type TraitSexMinWtMaxWt_t struct { Trait string // Same as traits in master hjson - e.g., WW is weaning weight Sex string // Sex S=steer and H=heifer calf MinWt float64 //If the weight of the animals is >= MaxWt float64 // and the weight of the animals is < PricePerPound float64 // read as per cwt but converted to per lb }