RUFAS.routines.animal.animal_module_reporter module#

class RUFAS.routines.animal.animal_module_reporter.AnimalModuleReporter#

Bases: 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(animal_manager) 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, feed: Feed, simulation_day: int) None#

For each pen, adds ration per animal and other supply reports, to output manager.

Parameters#

penPen

Pen object.

feedFeed

Instance of class Feed.

simulation_dayint

Day of simulation.

classmethod report_daily_ration(animal_manager, available_feeds: Dict[str, Dict[str, Any]]) None#

Adds ration totals as fed to each pen to output manager.

Parameters#

animal_managerAnimalManager

Instance of AnimalManager class.

available_feedsDict[str, Dict[str, Any]]

Available feeds dictionary from the Feed class object.

classmethod report_daily_feed_emissions(ration_total: dict[str, float], pen_id: int | str, pen_animal_name: str, animal_manager) 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_animal_module_manure(manure_excretions_output_data: dict[str, dict[str, str | AnimalManureExcretions]]) None#

Generate detailed report of manure properties in the Animal Module.

Parameters#

manure_excretions_output_datadict[str, dict[str, str | AnimalManureExcretions]]

Dictionary mapping prefixes to animal manure data.

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(life_cycle_manager: LifeCycleManager, sim_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_daily_pen_total(simulation_day: int, pen_list: List[Pen]) None#
classmethod report_sold_animal_information(life_cycle_manager: LifeCycleManager) 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: Sequence[Calf | HeiferI | HeiferII | HeiferIII | Cow], 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(animal_manager) 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(animal_manager, available_feeds: Dict[str, Dict[str, Any]]) 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(life_cycle_manager: LifeCycleManager, time: RufasTime, heiferIIs: List[HeiferII], cows: List[Cow]) None#

Calls all reporter methods that should happen at the end of the simulation.

Parameters#

life_cycle_managerLifeCycleManager

Instance of LifeCycleManager class.

timeRufasTime

The RufasTime object with the current time information.

heiferIIsList[HeiferII]

The list of HeiferIIs.

cowsList[Cow]

The list of Cows

classmethod _record_animal_events(animals: list[Calf | HeiferI | HeiferII | HeiferIII | Cow], simulation_day: int) None#

Record the events of the animals.

Parameters#

animalslist[Calf, HeiferI, HeiferII, HeiferIII, Cow]

A list of animals.

simulation_dayint

The current simulation day.

Returns#

None

classmethod _record_heiferIIs_conception_rate() None#

Record the conception rate of heiferIIs.

classmethod _record_cows_conception_rate() None#

Record the conception rate of cows.

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.