% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MFRCD.R
\name{mfrcd_check_repair}
\alias{mfrcd_check_repair}
\title{Generate, check, and optionally repair an MFRCD design}
\usage{
mfrcd_check_repair(
  levels,
  block_size = NULL,
  sep = "",
  use_mixedfact = TRUE,
  mixedfact_method = "auto",
  choose_block = "best",
  group1 = NULL,
  group2 = NULL,
  prefer = c("auto", "direct", "mixedfact"),
  tol = 1e-08,
  repair_if_disconnected = TRUE,
  replication = "auto",
  horizontal_reps = NULL,
  vertical_reps = NULL,
  max_per_row = NULL,
  max_per_column = NULL,
  max_iter = 100,
  max_candidates = NULL,
  seed = NULL,
  complete_set_prefer = c("rows", "columns"),
  max_complete_set_search = 100000L,
  treatment_universe = c("auto", "factorial", "observed"),
  verbose = FALSE
)
}
\arguments{
\item{levels}{Integer vector of factor levels.}

\item{block_size}{Block size used in the construction.}

\item{sep}{Character separator used in treatment labels.}

\item{use_mixedfact}{Logical; if TRUE, allow the mixedfact-based construction route.}

\item{mixedfact_method}{Method passed to mixedfact when that route is used.}

\item{choose_block}{Rule for choosing a block when several are available.}

\item{group1}{Optional integer vector of factor indices in the first group.}

\item{group2}{Optional integer vector of factor indices in the second group.}

\item{prefer}{Construction route preference.}

\item{tol}{Numerical tolerance.}

\item{repair_if_disconnected}{Logical; if TRUE, attempt repair when the design is disconnected.}

\item{replication}{Replication target or "auto".}

\item{horizontal_reps}{Maximum horizontal replication bound.}

\item{vertical_reps}{Maximum vertical replication bound.}

\item{max_per_row}{Maximum allowed occurrences of a treatment in a row.}

\item{max_per_column}{Maximum allowed occurrences of a treatment in a column.}

\item{max_iter}{Maximum number of repair iterations.}

\item{max_candidates}{Maximum number of candidate swaps to examine.}

\item{seed}{Optional random seed.}

\item{complete_set_prefer}{Preferred direction for complete-set reshuffling.}

\item{max_complete_set_search}{Maximum number of complete-set partitions to inspect.}

\item{treatment_universe}{Treatment universe used for connectedness and repair.}

\item{verbose}{Logical; if TRUE, emit progress or summary messages.}
}
\value{
A list, matrix, data frame, or classed object containing the requested row-column design information.
}
\description{
Generate, check, and optionally repair an MFRCD design.
}
\examples{
res <- mfrcd_check_repair(c(2, 2), repair_if_disconnected = FALSE, max_iter = 1, max_candidates = 5)
stopifnot(inherits(res, "mfrcd_check_repair"))
}
