RUFAS.biophysical.animal.animal_module_reporter module#
- class RUFAS.biophysical.animal.animal_module_reporter.AnimalModuleReporter#
Bases:
object
- _om = <RUFAS.output_manager.OutputManager object>#
- classmethod data_padder(reference_variable: str, full_variable_to_add: str, thing_to_add: Any, simulation_day: int, info_map: Dict[str, Any], units: Dict[str, MeasurementUnits] | MeasurementUnits) None #
Pads a variable in OutputManager for entries that it “missed” relative to another variable.
This is meant to be used prior to the addition of a variable to OutputManager, only in the cases where there may be a mismatch in variable lengths. A common case would be when a variable is stored in OutputManager by pen, and additional pens are created during the simulation.
This method checks the length of a reference variable (in the previous example, Pen 0) in OutputManager and the variable of interest (in the previous example, a newly created Pen 15), and if there is a mismatch greater than one, it makes the number of calls to OutputManager necessary to ensure the length of the variable to add is one less than the reference variable using “blank” data.
Parameters#
- reference_variablestr
The “reference” variable name as found in om.variables_pool. In the case of a pen, this should be pen 0 (as it will always be instantiated at the start of the simulation).
- full_variable_to_add: str
The variable name as found in om.variables_pool.
- thing_to_addAny
The variable data to pad the om.variables_pool with.
- simulation_day: int
The day of the simulation.
- info_map: Dict[str, Any]
The info_map to use when padding.
- units: Dict[str, str] | str
Units for the variable being added, in the format provided in the main call to add_variable, (e.g. the one following the call of data_padder).
- classmethod report_daily_animal_population(herd_statistics: HerdStatistics, simulation_day: int) None #
Adds daily totals for animal types to output manager.
Parameters#
- animal_managerAnimalManager
Instance of AnimalManager
- classmethod report_milk(pen: Pen, simulation_day: int) None #
Adds milk information for all cows in pen to output manager.
Parameters#
- penPen
Individual Pen.
- simulation_dayint
Day of simulation.
- classmethod report_ration_interval_data(pen: Pen, simulation_day: int) None #
For each pen, adds ration per animal and other supply reports, to output manager.
Parameters#
- penPen
Pen object.
- simulation_dayint
Day of simulation.
- classmethod _report_ration_per_animal(pen: Pen, simulation_day: int) dict[int, float] #
For each pen, adds the average ration per animal to the OutputManager.
Parameters#
- penPen
Pen object.
- simulation_dayint
Day of simulation.
Returns#
- dict[int, float]
Map of RuFaS Feed IDs to amounts of that feed in the ration (kg dry matter).
- classmethod _report_nutrient_amounts(pen: Pen, simulation_day: int) None #
Reports the amounts of nutrients in the ration.
- classmethod _report_average_nutrient_requirements(pen: Pen, simulation_day: int) None #
Adds the average ration per animal of a pen to the OutputManager.
Parameters#
- penPen
Pen object.
- simulation_dayint
Day of simulation.
- classmethod _report_average_nutrient_evaluation_results(pen: Pen, simulation_day: int) None #
Reports the average nutrient evaluation results for a pen. Parameters ———- pen : Pen
Pen object.
- simulation_dayint
Day of simulation.
- classmethod _report_me_diet(pen: Pen, simulation_day: int) None #
Report the total metabolizable energy of a pen’s average ration to the Output Manager as “MEdiet”.
Parameters#
- penPen
Pen object.
- simulation_dayint
Day of simulation.
- classmethod report_daily_ration(herd_manager, simulation_day: int) None #
Adds ration totals as fed to each pen to output manager.
Parameters#
- herd_managerHerdManager
Instance of HerdManager class.
simulation_day : int
- classmethod _report_daily_ration_per_pen(pen: Pen, simulation_day: int, herd_manager) dict[str, float] #
Calculates and reports the total amounts of feed fed to animals in a pen in a given day.
Parameters#
- penPen
Pen object.
- simulation_dayint
Day of simulation.
- herd_managerHerdManager
Herd Manager object.
Returns#
- dict[str, float]
Maps the RuFaS Feed ID (as a string) to the total amount of that feed used for the given pen, as well as the total amounts of all feeds and byproducts used for the given pen (kg dry matter).
- classmethod report_daily_feed_emissions(ration_total: dict[str, float], pen_id: int | str, pen_animal_name: str, animal_manager, simulation_day: int) None #
Adds emissions totals from purchased feeds on a pen / feed basis.
Parameters#
- ration_totaldict[str, float]
Total amounts of dry matter per feed type fed to the pen.
- pen_idint | str
The unique number identifying a pen. Use ALL when the given ration is the sum of mulitple pens’ rations.
- pen_animal_namestr
The name of the animal combination in a pen.
- animal_managerAnimalManager
The AnimalManager instance being reported.
- classmethod report_enteric_methane_emission(enteric_methane_emission_by_pen: dict[str, float]) None #
- classmethod report_manure_streams(manure_streams: dict[str, ManureStream], simulation_day: int) None #
Report Animal Module manure stream data to Output Manager.
Parameters#
- manure_streamsdict[str, ManureStream]
A dictionary of manure stream data, where the key is the formatted stream name and the value is the ManureStream object.
- simulation_dayint
The simulation day.
- classmethod report_manure_excretions(manure_excretions: dict[str, AnimalManureExcretions], simulation_day: int) None #
Report pen AnimalManureExcretions to Output Manager.
Parameters#
- manure_excretionsdict[str, AnimalManureExcretions]
A dictionary of manure excretion data, where the key is the formatted base name and the value is the AnimalManureExcretions object.
- simulation_dayint
The simulation day.
- classmethod report_pen_manure_properties(pen: Pen, simulation_day: int) None #
Adds pen manure properties to output manager.
Parameters#
- penPen
Current pen.
- classmethod report_life_cycle_manager_data(herd_statistics: HerdStatistics, simulation_day: int) None #
Adds daily life cycle data to output manager.
- life_cycle_managerLifeCycleManager
Active instance of LifeCycleManager.
- sim_dayint
Day of simulation.
- classmethod report_sold_animal_information(herd_statistics: HerdStatistics) None #
Adds a dictionary of sold animal information to the output manager.
Parameters#
- life_cycle_managerLifeCycleManager
Instance of Class LifeCycleManager.
- classmethod report_sold_animal_information_sort_by_sell_day(sold_animals: list[SoldAnimalTypedDict], report_name: str, total_days: int) None #
Adds a dictionary of sold animal information to the output manager on daily basis.
Parameters#
- sold_animalslist[object]
List of sold animals.
- report_namestr
The string to be appended to the variable being reported to the OM.
- total_daysint
The total number of days in the simulation
- classmethod report_305d_milk(lactating_cows: list[Animal]) None #
Adds herd mean of latest_milk_production_305days to output manager, though only for lactating cows with nonzero values.
Parameters#
- animal_managerAnimalManager
Instance of Animalmanager class.
- classmethod report_daily_reports(herd_manager, simulation_day: int) None #
Calls all reporter methods that should happen at the end of each day.
Parameters#
- animal_managerAnimalManager
Instance of AnimalManager class.
- available_feedsDict[str, Dict[str, Any]]
Available feeds dictionary from the Feed class object.
- classmethod report_end_of_simulation(herd_statistics: HerdStatistics, herd_reproduction_statistics: HerdReproductionStatistics, time: RufasTime, heiferIIs: List[Animal], cows: List[Animal]) None #
Calls all reporter methods that should happen at the end of the simulation.
Parameters#
- herd_statisticsHerdStatistics
Instance of HerdStatistics class.
- herd_reproduction_statisticsHerdReproductionStatistics
Instance of HerdReproductionStatistics class.
- timeRufasTime
The RufasTime object with the current time information.
- heiferIIsList[Animal]
The list of HeiferIIs.
- cowsList[Animal]
The list of Cows
- classmethod _record_animal_events(animals: list[Animal], simulation_day: int) None #
Record the events of the animals.
Parameters#
- animalslist[Animal]
A list of animals.
- simulation_dayint
The current simulation day.
Returns#
None
- classmethod _record_heiferIIs_conception_rate(herd_reproduction_statistics: HerdReproductionStatistics) None #
Record the conception rate of heiferIIs.
- classmethod _record_cows_conception_rate(herd_reproduction_statistics: HerdReproductionStatistics) None #
Record the conception rate of cows.
- classmethod report_animal_population_statistics(prefix: str, herd_summary: AnimalPopulationStatistics) None #
Reports the herd summary statistics for the starting animal population.
- classmethod report_total_disease_days() None #
Adds total animal-days of disease to Output Manager.
- classmethod report_disease_incidence() None #
Adds disease-incidence data to Output Manager.
- classmethod report_lost_milk_production() None #
Reports lost milk production due to disease to Output Manager.
- classmethod report_feed_efficiency_decreases() None #
Reports feed efficiency decreases due to disease to Output Manager.
- classmethod report_milk_co2_increases() None #
Reports increases in milk kgCO2/kgMilk due to disease to Output Manager.
- classmethod report_income_losses() None #
Reports losses in income due to disease to Output Manager.