Implements the Permuted Block Randomization (PBR) method, supporting both fixed and randomized block designs for treatment allocation.
Fields
nameCharacter string specifying the method name.
uniqueIdCharacter string uniquely identifying the method instance.
blockSizeRandomizerRandomBlockSizeRandomizerobject for selecting block sizes randomly.blockSizesList of block size configurations, each mapping treatment arm IDs to sizes.
fixedBlockDesignEnabledLogical indicating if a fixed block design is used.
fixedBlockIndexInteger specifying the index of the fixed block size to use.
Methods
- initialize(...)
Initializes a new
RandomMethodPBRinstance, validates block size settings, and assigns a unique ID.- show()
Prints a string representation of the method.
- toString()
Returns a string representation of the method and its configuration.
- randomize(factorLevels, randomSystemState, randomAllocationValue)
Performs randomization using PBR, updates system state, and returns a
RandomResult.- getNextRandomBlockSize()
Retrieves the next block size configuration, either fixed or randomized.