Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Nov 20, 2023
1 parent 4253ef5 commit 2fd62b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/setup_computation.R
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,15 @@ create_S_batch_new <- function(internal, seed = NULL) {
# Ensure that the number of batches is not larger than `n_batches`.
# Remove one batch from the approach with the most batches.
while (sum(batch_count_dt$n_batches_per_approach) > n_batches) {
batch_count_dt[which.max(n_batches_per_approach),n_batches_per_approach:=n_batches_per_approach-1]
batch_count_dt[which.max(n_batches_per_approach),
n_batches_per_approach := n_batches_per_approach - 1]
}

# Ensure that the number of batches is not lower than `n_batches`.
# Add one batch to the approach with most coalitions per batch
while (sum(batch_count_dt$n_batches_per_approach) < n_batches) {
batch_count_dt[which.max(n_S_per_approach/n_batches_per_approach),
n_batches_per_approach:=n_batches_per_approach+1]
batch_count_dt[which.max(n_S_per_approach / n_batches_per_approach),
n_batches_per_approach := n_batches_per_approach + 1]
}
}

Expand Down

0 comments on commit 2fd62b5

Please sign in to comment.