Extract inputs for the multi-role workload allocation model
Source:R/extract_fns.R
extract_multirole_info.RdConverts individual-level data, role-specific preference matrices, and role
demand into the list expected by prepare_multirole_model().
Arguments
- student_df
A data frame with one row per individual. By default, its first four columns must be named
student_id,year,past_ta, andpast_gr, in that order. Withsingle_semester = TRUE, onlystudent_idandyearare required as the first two columns.yearis capped to the range 1-4.- d_mat
Numeric demand matrix with
Njrows and two or three columns. Columns are interpreted as TA, GR, and optional E.- p_ta_mat
Optional numeric TA preference matrix with dimensions
Ns x Nj.- p_gr_mat
Optional numeric GR preference matrix with dimensions
Ns x Nj.- e_mode
How to handle E demand when
d_mathas no E column."rr"computes E demand by round-robin allocation from highest to lowest GR demand;"none"sets E demand to zero.- C
Semester workload capacity per individual. It is stored in the extracted input and used by
prepare_multirole_model()to set annual workload to2 * C. It also determines E demand whene_mode = "rr".- s
Numeric vector containing E-allocation scores for Years 1, 2, 3, and 4. Larger values make E allocation more attractive when the
phiterm is active.- single_semester
Logical flag. When
TRUE, supplied past-workload columns are ignored and extraction returns synthetic prior workloadst1 = 0andg1 = Cfor every individual.
Details
Preference matrices are optional during extraction because their objective
terms can be disabled in prepare_multirole_model(). When beta_ta or
beta_gr is active, the corresponding matrix must be present.
Input order must already be aligned: row i in each preference matrix must
correspond to row i in student_df, and demand row j must correspond to
preference column j.
In single-semester mode, the uniform synthetic GR workload does not change
the GR workload spread. It fills the prior-semester half of annual capacity,
leaving C units per individual for current allocation.