RotationPhases module

This module reads in rotation information that has been generated from RotGeneration.py and manipulates it to produce the rotation parameters.

The flexible and detailed handling of rotation decisions allows the representation of paddock history on the current landuse to be represented as well as the tactical and strategical decisions that accompany rotation. Such as delaying the choice of rotation phase at the start of the growing season and changing rotation phase later in the growing season. Or even adding a summer crop if the season permits.

author: young

AfoLogic.RotationPhases.f_landuses_phases(params, r_vals)
  • Read in the rotation list generated by RotGeneration.py

  • Create rotation area parameter for pyomo (simply each rotation phase uses 1ha of area).

  • Store rotation list and pasture phases list to report dictionary

Create parameters for phase link constraint. These parameters mask when phase can be changed and also force a change of phase at the break of each season (change is required because some costs e.g. seeding are connected to v_phase_change_increase.

Phases from p7_prev dont transfer in the p7 period immediately preceding the break of season for each weather-year (z). To force a v_phase_change (to current season land-use or to PNC) at the break. Dry sown phases can’t transfer between seasons but they can at break of the medium and late seasons.

Note: a2 phases dont provide a history. This is required to stop pnc being selected all growing season (if the model wants pasture it has to change to normal pasture and will incur any prior costs).

AfoLogic.RotationPhases.f_rot_hist4_params(params)

History 4 constraint is used to ensure dual landuse follows the correct part a landuse.

AfoLogic.RotationPhases.f_rot_hist_params(params)

Create parameters for landuse history provided and required by each rotation phase.

AfoLogic.RotationPhases.f_rot_lmu_params(params)

Create parameters for lmu area.

AfoLogic.RotationPhases.f_season_params(params)

Create params for phase period transfer.

AfoLogic.RotationPhases.f_v_phase_increment_adj(param, p7_pos, z_pos, p5_pos=None, numpy=False)

Adjust v_phase param for v_phase_change_increase.

v_phase_change_increase must incur the requirement to date for labour and cash for the phase. This is making the assumption that any jobs carried out, and any expenditure (fertiliser or chemical applied) will be applied even though the phase is selected later in the year. This stops the optimisation selecting the phase in the last node and receiving the income without incurring any costs.

Note 1: Yield and stubble do not require increment params because it is not possible to harvest a rotation before the rotation is selected.

Note 2: labour gets handled slightly different. Labour that occurs in previous labour periods before the season

period when v_phase_change_increase is selected must be completed in the first labour period when the phase is selected.

Note 3: f_v_phase_increment_adj starts counting from the start of season but there are no phase costs/labour between until

after the break for each season otherwise costs would get double counted in medium/late breaks where phases are carried over past the start of the season to provide dry pas and stubble area.

Parameters:
  • param – numpy array or pandas series - parameter with p7 axis.

  • p7_pos – negative int: axis/level of p7

  • z_pos – negative int: axis/level of z

  • p5_pos – optional negative int: axis/level of p5 axis.

  • numpy – Boolean, stating if param is numpy.