RUFAS.biophysical.animal.ration.user_defined_ration_manager module#

class RUFAS.biophysical.animal.ration.user_defined_ration_manager.UserDefinedRationManager#

Bases: object

Handles the initialization and management of user-defined animal rations.

Attributes#

user_defined_rationsdict[AnimalCombination, dict[RUFAS_ID, float]]

A mapping of animal groupings to their respective ration formulations.

Each ration formulation is represented as a dictionary, where the key is the RuFaS ID of a feed and the value is the percentage it contributes to the ration.

CALF_DRY_MATTER_INTAKE = 3#
_om = <RUFAS.output_manager.OutputManager object>#
user_defined_rations: dict[AnimalCombination, dict[int, float]]#
classmethod set_user_defined_rations(ration_config: dict[str, dict[str, list[dict[str, int | float]] | float]]) None#

Maps the input user-defined rations to Animal combinations.

Parameters#

ration_configdict[str, dict[str, list[dict[str, int | float]] | float]]

List of dictionaries containing the user-defined rations for each animal combination.

classmethod get_user_defined_ration(animal_combination: AnimalCombination, requirements: NutritionRequirements) dict[int, float]#

Generate a ration for the given animal type scaled to the estimated dry matter intake requirement.

Parameters#

animal_combinationAnimalCombination

The combination of animals in the pen.

requirementsNutritionRequirements

The nutrition requirements of an animal or average of a group of animals.

Returns#

dict[RUFAS_ID, float]

A mapping of feed RuFaS IDs to the amount of feed required in the ration (kg dry matter).

classmethod get_user_defined_ration_feeds(animal_combination: AnimalCombination) list[int]#

Generate a list of feed RuFaS IDs for the given animal combination that user defined to be used as the ration.

Parameters#

animal_combinationAnimalCombination

The combination of animals in the pen.

Returns#

list[RUFAS_ID]

A list of feed RuFaS IDs that user defined to be used as the feed for the given animal combination.