Default Objective Function for Design Optimization
Arguments
- layout_df
A data frame representing the current design
- swap
A column name of the items to be swapped
- spatial_cols
Column name(s) of the spatial factors
- ...
Extra parameters passed from speed
- adj_weight
Weight for adjacency score (default: 1)
- bal_weight
Weight for balance score (default: 1)
- row_column
Name of column representing the row of the design (default: "row")
- col_column
Name of column representing the column of the design (default: "col")
Examples
layout_df <- data.frame(
row = rep(1:3, each = 3),
col = rep(1:3, times = 3),
treatment = rep(letters[1:3], 3)
)
objective_function(layout_df, "treatment", c("row", "col"))
#> $score
#> [1] 15
#>