## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## -----------------------------------------------------------------------------
single_semester_students <- grouper::multirole_students_ex001[
  , c("student_id", "year", "Name")
]

single_semester_inputs <- grouper::extract_multirole_info(
  student_df = single_semester_students,
  d_mat = grouper::multirole_demand_ex001,
  p_ta_mat = grouper::multirole_prefmat_ex001,
  e_mode = "rr",
  C = 4,
  single_semester = TRUE
)

cbind(t1 = single_semester_inputs$t1, g1 = single_semester_inputs$g1)

## -----------------------------------------------------------------------------
default_inputs <- grouper::extract_multirole_info(
  student_df = grouper::multirole_students_ex001,
  d_mat = grouper::multirole_demand_ex001,
  p_ta_mat = grouper::multirole_prefmat_ex001,
  p_gr_mat = grouper::multirole_prefmat_ex001,
  e_mode = "none"
)

default_inputs$s

## -----------------------------------------------------------------------------
custom_inputs <- grouper::extract_multirole_info(
  student_df = grouper::multirole_students_ex001,
  d_mat = grouper::multirole_demand_ex001,
  p_ta_mat = grouper::multirole_prefmat_ex001,
  p_gr_mat = grouper::multirole_prefmat_ex001,
  e_mode = "none",
  s = c(0, 1, 3, 6)
)

custom_inputs$s

## -----------------------------------------------------------------------------
multi_role_model <- grouper::prepare_model(
  default_inputs,
  assignment = "multirole",
  alpha_ta = 2,
  alpha_gr = 2,
  beta_ta = 1,
  beta_gr = 1,
  phi = 1,
  rho_ta = 10,
  rho_gr = 10,
  protected_year_ta = 1,
  protected_year_gr = 3,
  ta_protected_max = 1,
  gr_protected_max = 1
)

## -----------------------------------------------------------------------------
ta_only_model <- grouper::prepare_multirole_model(
  default_inputs,
  alpha_gr = NULL,
  beta_gr = NULL,
  rho_gr = NULL
)

