If you run a simulation with no animals, you should still be able to initialize a Tractor to do tillage.
There are a few aspects to this issue:
- To initialize a Tractor, you need EITHER
herd_size OR tractor_size.
In the Tractor class, the first step in the init method is:
if not tractor_size and not herd_size:
raise ValueError("At least one of `tractor_size` or `herd_size` must be given.")
In the init, both herd_size and tractor_size are optional parameters:
class Tractor:
...
def __init__(
self,
operation_event: FieldOperationEvent,
crop_type: str | None = None,
tractor_size: TractorSize | None = None,
herd_size: int | None = None,
application_depth: float | None = None,
tillage_implement: TillageImplement | None = None,
harvest_type: HarvestOperation | None = None,
) -> None:
- We don't have a current way to NOT have animal
herd_num (aka herd_size) in the IM pool.
There is a default of 100 for herd_num and a minimum of 6. This means if you set it to 0 or leave it out altogether, it will be 100. The problem is that this could lead to silent emissions/energy use outside of tillage/tractor calculations that someone running a simulation without animals would not be expecting and could have misleading results/outputs.
Ideally if there aren't animals in the simulation, we should be checking to make sure there is a tractor_size in the inputs.
If you run a simulation with no animals, you should still be able to initialize a
Tractorto do tillage.There are a few aspects to this issue:
herd_sizeORtractor_size.In the
Tractorclass, the first step in theinitmethod is:In the
init, bothherd_sizeandtractor_sizeare optional parameters:herd_num(akaherd_size) in the IM pool.There is a default of 100 for
herd_numand a minimum of 6. This means if you set it to 0 or leave it out altogether, it will be 100. The problem is that this could lead to silent emissions/energy use outside of tillage/tractor calculations that someone running a simulation without animals would not be expecting and could have misleading results/outputs.Ideally if there aren't animals in the simulation, we should be checking to make sure there is a
tractor_sizein the inputs.