# The sum of weights will form the simulated population so this must match
# the population from cons
if (!isTRUE(all.equal(sum(weights), (sum(cons) / length(vars))))) {
stop("Weight populations don't match constraint populations.
Usually this means the populations for each of your constraints
are slightly different\n",
"Sum of simulated population: ", sum(weights), "\n",
"Sum of constraint population: ", (sum(cons) / length(vars)))
}
In
rk_weight()
: