RUFAS.routines.animal.ration.user_defined_ration module#
- class RUFAS.routines.animal.ration.user_defined_ration.UserDefinedRationManager#
Bases:
object
Reads in the user_defined_ration JSON and collects variables as Dicts. Methods return rations and change keys in the dict as needed.
- __instance = <RUFAS.routines.animal.ration.user_defined_ration.UserDefinedRationManager object>#
- __init__() None #
- static ration_to_use(animal_combination: AnimalCombination) Dict[str, float] #
Function outputs the dictionary for a given animal combination from the UserDefinedRationManager class
Parameters#
- animal_combinationAnimalCombination
AnimalCombination in the given pen
Returns#
- ration_percentsDict
dictionary of feed ids and their associated percentage of DMI
- static make_ration_from_user_values(ration_percents: Dict[str, float], available_feeds: AvailableFeedsTypedDict, req: AnimalRequirements) Dict[str, float | str] #
Generate ration dict from user ration percents input, scaled to their estimated dry matter intake (DMI)
Parameters#
- ration_percentsDict[str, float]
Dictionary of feed ids and their desired percentages of estimated DMI.
- available_feedsAvailableFeeds
Available feeds dictionary from the Feed class object.
req : an object of class Requirements
Returns#
- Dict[str, float]
dictionary of formulated ration
- instance = <RUFAS.routines.animal.ration.user_defined_ration.UserDefinedRationManager object>#