% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/optim_designs_crop_mix.R
\name{getDesignBinaryCropMix}
\alias{getDesignBinaryCropMix}
\title{Optimize design for binary crop mixtures}
\usage{
getDesignBinaryCropMix(
  levGenos1,
  levGenos2,
  nbMixes,
  seed = NULL,
  showPlots = FALSE,
  verbose = FALSE
)
}
\arguments{
\item{levGenos1}{character vector with the names of the genotypes of the first species}

\item{levGenos2}{character vector with the names of the genotypes of the second species}

\item{nbMixes}{number of mixtures}

\item{seed}{seed for the pseudo-random number generator}

\item{showPlots}{logical indicating if plots should be showed}

\item{verbose}{verbosity level}
}
\value{
list
}
\description{
Optimizes a design for binary crop mixtures
}
\examples{
nbGenos1 <- 30
levGenos1 <- sprintf(fmt=paste0("S1_\%0", floor(log10(nbGenos1))+1, "i"),
                     1:nbGenos1)
nbGenos2 <- 8
levGenos2 <- sprintf(fmt=paste0("S2_\%0", floor(log10(nbGenos2))+1, "i"),
                     1:nbGenos2)
nbMixes <- 60 # only binary and balanced
design <- getDesignBinaryCropMix(levGenos1, levGenos2, nbMixes, seed=12345)
plotDesignCropMix(design$graph, levGenos1, levGenos2)
ggplot(design$entropies) + aes(x=iteration, y=entropy, group=type) + geom_point() + geom_line() +
  geom_hline(yintercept = design$max_ent) + theme_bw() + facet_wrap(~ type)
}
\author{
Timothee Flutre
}
