View source: R/build_blueprint_blocks.R
| build_blueprint_blocks | R Documentation |
Constructs an initial set of forced-choice blocks that strictly adhere to a user-specified blueprint (e.g., exact trait and keying combinations for every block). It utilizes a fast random-search heuristic to simultaneously optimize a specified matching criterion (e.g., minimizing within-block difficulty variance).
This function acts as an excellent "Smart Initializer" before passing the
resulting blocks into assemble_blocks() for further global optimization.
build_blueprint_blocks(
item_chars,
blueprint,
bp_block_col = "block",
bp_trait_col = "trait",
bp_sign_col = "sign",
bp_crit_col = NULL,
df_id_col = "item_num",
df_trait_col = "trait",
df_sign_col = "sign",
df_crit_col = NULL,
optim_func = NULL,
adjust_factor = 1.1,
max_comb_attempts = 100,
max_adjust_attempts = 5
)
item_chars |
A data frame containing the item pool characteristics. Each row represents a single item. |
blueprint |
A data frame detailing the exact structural requirements for every block. Must contain columns mapping to the block ID, required trait, and required keying direction. |
bp_block_col |
Character string. The column name in |
bp_trait_col |
Character string. The column name in |
bp_sign_col |
Character string. The column name in |
bp_crit_col |
Character string. Optional. The column name in |
df_id_col |
Character string. The column name in |
df_trait_col |
Character string. The column name in |
df_sign_col |
Character string. The column name in |
df_crit_col |
Character string. Optional. The column name in |
optim_func |
Character string or function object. Optional. The function used to evaluate the
items within a block (e.g., |
adjust_factor |
Numeric value > 1. The multiplier used to relax the matching criterion target
if a valid combination cannot be found. For example, |
max_comb_attempts |
Integer. The maximum number of random combinations to generate and test
against the matching criterion before relaxing the target. Defaults to |
max_adjust_attempts |
Integer. The maximum number of times to relax the target criterion using
|
A data frame containing the successfully matched items. The data frame will include
all original columns from item_chars, plus tracking columns N_adjusts,
final_criteria, and block_id.
If the algorithm fails to construct a block due to depleted inventory or overly strict
criteria, it returns the partially built scale up to the point of failure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.