RUFAS.routines.manure.beddings.bedding_classes module#
- class RUFAS.routines.manure.beddings.bedding_classes.BeddingType(*values)#
Bases:
Enum
Enumerate the different types of bedding.
This class provides a set of predefined constants that represent different types of bedding such as sawdust, straw, and sand. The default type is sand.
Attribute#
- SAWDUSTstr
Represent the ‘sawdust’ type of bedding.
- CBPB_SAWDUSTstr
Represent the ‘CBPB sawdust’ type of bedding.
- MANURE_SOLIDSstr
Represent the ‘manure solids’ type of bedding.
- STRAWstr
Represent the ‘straw’ type of bedding.
- SANDstr
Represent the ‘sand’ type of bedding.
- NONEstr
Represent no bedding.
- SAWDUST = 'sawdust'#
- CBPB_SAWDUST = 'CBPB sawdust'#
- MANURE_SOLIDS = 'manure solids'#
- STRAW = 'straw'#
- SAND = 'sand'#
- NONE = 'none'#
- class RUFAS.routines.manure.beddings.bedding_classes.BeddingConfig(bedding_mass_per_day: float, bedding_density: float, bedding_dry_matter_content: float, bedding_cleaned_fraction: float, bedding_carbon_fraction: float, bedding_phosphorus_content: float, bedding_type: RUFAS.routines.manure.beddings.bedding_classes.BeddingType, sand_removal_efficiency: float)#
Bases:
object
- bedding_mass_per_day: float#
Quantity of bedding required per animal per day (\(kg/animal/day\)).
- bedding_density: float#
Density of the bedding (\(kg/m^3\)).
- bedding_dry_matter_content: float#
Dry matter content in the bedding (unitless). Value should be in the range \([0.7 - 1.0]\).
- bedding_cleaned_fraction: float#
Fraction of bedding that is removed from the barn (unitless). Value should be in the range \([0.7 - 1.0]\).
- bedding_carbon_fraction: float#
Fraction of bedding that is composed of carbon (unitless). Value should be in the range \([0.0 - 1.0]\).
- bedding_phosphorus_content: float#
Quantity of phosphorus in the bedding (kg).
- bedding_type: BeddingType#
Type of bedding.
- sand_removal_efficiency: float#
Efficiency of removing sand from the bedding (unitless). Value should be in the range \([0.7 - 1.0]\).
- __init__(bedding_mass_per_day: float, bedding_density: float, bedding_dry_matter_content: float, bedding_cleaned_fraction: float, bedding_carbon_fraction: float, bedding_phosphorus_content: float, bedding_type: BeddingType, sand_removal_efficiency: float) None #
- class RUFAS.routines.manure.beddings.bedding_classes.BaseBedding(name: str, bedding_config: BeddingConfig)#
Bases:
ABC
Abstract base class for all bedding types.
This class provides a base for all bedding types. It initializes with a configuration of bedding attributes and includes methods for calculating various bedding properties.
Attributes#
- namestr
The name of the bedding.
- bedding_mass_per_dayfloat
Quantity of bedding required per animal per day (kg/animal/day).
- bedding_densityfloat
Density of the bedding (kg/\(m^3\)).
- bedding_dry_matter_contentfloat
Dry matter content in the bedding (unitless). Value should be in the range [0.7 - 1.0].
- bedding_cleaned_fractionfloat
Fraction of bedding that is removed from the barn (unitless). Value should be in the range [0.7 - 1.0].
- bedding_carbon_fractionfloat
Fraction of bedding that is composed of carbon (unitless). Value should be in the range [0.0 - 1.0].
- bedding_phosphorus_contentfloat
Quantity of phosphorus in the bedding (kg).
- bedding_typestr
Type of bedding as a string.
Methods#
- calc_total_bedding_washed(num_animals: int) -> float
Calculates total amount of bedding washed away.
- calc_total_bedding_mass(num_animals: int) -> float
Calculates total amount of bedding needed.
- calc_total_bedding_volume(num_animals: int) -> float
Calculates total volume of bedding needed.
- calc_total_bedding_dry_solids(num_animals: int) -> float
Calculates total dry solids in the bedding.
- __init__(name: str, bedding_config: BeddingConfig) None #
Initialize the base bedding class with specific configuration data.
Parameters#
- namestr
Identifier for the bedding configuration being used here.
- bedding_configBeddingConfig
A BeddingConfig object that specifies configuration data specific to the choice of bedding.
- calc_total_bedding_washed(num_animals: int) float #
Calculate the total amount of bedding that is washed away.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total amount of bedding that is washed away (kg/animal/day).
- abstractmethod calc_total_bedding_mass(num_animals: int) float #
Abstract method to calculate the total amount of bedding needed for all animals.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total amount of bedding needed for all animals (kg/day).
- abstractmethod calc_organic_bedding_mass_added_to_manure(bedding_mass: float) float #
Calculates how much organic bedding material was added to the total mass of manure on a single day.
Parameters#
- bedding_massfloat
Mass of bedding used for the animals (kg).
Returns#
- float
The mass of organic bedding material added to manure (kg).
- calc_total_bedding_volume(num_animals: int) float #
Calculate the total volume of bedding needed for all animals.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total volume of bedding needed for all animals (\(m^3\)/day).
- calc_total_bedding_dry_solids(num_animals: int) float #
Calculate the total amount of dry solids in the bedding.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total amount of dry solids in the bedding (kg/day).
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.BaseOrganicBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseBedding
Abstract base class for all organic bedding types.
This class extends the BaseBedding class and provides a method to calculate the total amount of bedding needed for all animals in a pen.
- calc_total_bedding_mass(num_animals: int) float #
Calculate the total amount of bedding needed for all animals in the given pen.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
Total amount of bedding needed for all animals in the given pen (kg/day).
- calc_organic_bedding_mass_added_to_manure(bedding_mass: float) float #
Calculates the amount of organic bedding mass added to manure (kg).
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.SawdustBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseOrganicBedding
A concrete class representing sawdust bedding.
All attributes and methods are inherited from BaseOrganicBedding.
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.CBPBSawdustBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseOrganicBedding
A concrete class representing sawdust bedding type for compost bedded pack barns.
All attributes and methods are inherited from BaseOrganicBedding.
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.ManureSolidsBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseOrganicBedding
A concrete class representing manure solids bedding.
All attributes and methods are inherited from BaseOrganicBedding.
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.StrawBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseOrganicBedding
A concrete class representing straw bedding.
All attributes and methods are inherited from BaseOrganicBedding.
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.SandBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseBedding
A concrete class representing sand bedding.
In addition to the attributes inherited from the parent classes, this class also includes sand_removal_efficiency.
Attributes#
- sand_removal_efficiencyfloat
Efficiency of removing sand from the bedding (unitless). Range: [0.0, 1.0].
- __init__(name: str, bedding_config: BeddingConfig) None #
Initialize the sand bedding class with a specific configuration.
Parameters#
- namestr
Identifier for the sand bedding configuration being used here.
- bedding_configBeddingConfig
A BeddingConfig object that specifies config data for sand bedding.
- calc_total_bedding_mass(num_animals: int) float #
Calculate the total amount of bedding needed for all animals in the given pen.
The total mass is adjusted by the efficiency of sand removal.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
Total amount of bedding needed for all animals in the given pen (kg/day).
- calc_organic_bedding_mass_added_to_manure(bedding_mass: float) float #
Sand bedding is not organic, so the organic mass added to manure is always 0.
- _abc_impl = <_abc._abc_data object>#
- class RUFAS.routines.manure.beddings.bedding_classes.NoBedding(name: str, bedding_config: BeddingConfig)#
Bases:
BaseBedding
A concrete class representing no bedding.
Notes#
Because this class represents no bedding, it overrides inherited methods to simply return 0.0, to avoid possible division-by-zero errors.
- _abc_impl = <_abc._abc_data object>#
- calc_total_bedding_washed(num_animals: int) float #
Calculate the total amount of bedding that is washed away.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total amount of bedding that is washed away (kg/animal/day).
- calc_total_bedding_mass(num_animals: int) float #
Abstract method to calculate the total amount of bedding needed for all animals.
Parameters#
- num_animalsint
The number of animals in the pen.
Returns#
- float
The total amount of bedding needed for all animals (kg/day).
- calc_organic_bedding_mass_added_to_manure(bedding_mass: float) float #
Calculates how much organic bedding material was added to the total mass of manure on a single day.
Parameters#
- bedding_massfloat
Mass of bedding used for the animals (kg).
Returns#
- float
The mass of organic bedding material added to manure (kg).
- class RUFAS.routines.manure.beddings.bedding_classes.BeddingFactory#
Bases:
object
A factory class for creating bedding objects.
Notes#
This class leverages the Factory design pattern to instantiate bedding objects of different types. Based on the bedding type and the configuration provided, a new bedding instance will be manufactured.
- classmethod get_instance(bedding_name: str, bedding_config: BeddingConfig) BaseBedding #
Create a bedding object of the specified type.
Parameters#
- bedding_namestr
Name of the bedding configuration to be used.
- bedding_configBeddingConfig
Configuration of the bedding to be used.
Returns#
- BaseBedding
Bedding object of the specified type.