Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion R/class_random_block_size_randomizer.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ RandomBlockSizeRandomizer <- setRefClass("RandomBlockSizeRandomizer",
initRandomValues = function(numberOfBlockSizes, ..., numberOfValuesToCreate = 1000L) {
.self$values <- sample.int(n = numberOfBlockSizes, size = numberOfValuesToCreate, replace = TRUE)
},
nextInt = function(numberOfBlockSizes) { # TODO implement numberOfBlockSizes
nextInt = function(numberOfBlockSizes) {
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the inline TODO comment from the function signature improves readability, but the function parameter numberOfBlockSizes is not actually used in the function body (only the pre-initialized values are used). Consider adding a comment in the function documentation explaining that this parameter is not yet implemented but is reserved for issue #7.

Copilot uses AI. Check for mistakes.
if (length(values) == 0) {
stop("Block size randomizer not initialized. Call initRandomValues() first")
}
if (index > length(values)) {
stop("No more random block sizes available")
}

# TODO implement numberOfBlockSizes check (https://github.com/RCONIS/randomforge/issues/7)

value <- values[index]
.self$index <- index + 1L
return(value)
Expand Down
5 changes: 1 addition & 4 deletions R/class_random_method_pbr.R
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ RandomMethodPBR <- setRefClass("RandomMethodPBR",

blockSize <- blockSizes[[randomIndex]]

# TODO logging
# Map<String, Object> rndLoggerValues = new HashMap<String, Object>()
# rndLoggerValues.put("blockSize", "new random block size: " + blockSize + " (random index: " + randomIndex + ")")
# logger.info("Random configuration set: " + rndLoggerValues)
# TODO log this (https://github.com/RCONIS/randomforge/issues/6)

return(blockSize)
}
Expand Down
2 changes: 1 addition & 1 deletion R/class_random_method_range_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ RandomMethodRangeSet <- setRefClass("RandomMethodRangeSet",
d <- 0
sum <- 0
randomMethodRanges <- list()
# TODO sort randomMethodRanges
# TODO sort randomMethodRanges (https://github.com/RCONIS/randomforge/issues/9)

for (range in randomMethodRanges) {
sum <- sum + range$getUpperBound() - range$getLowerBound()
Expand Down
2 changes: 1 addition & 1 deletion R/class_random_system_state.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ RandomSystemState <- setRefClass("RandomSystemState",
fillingLevel <- fillingLevel + 1L
.self$fillingLevelsOverall[[treatmentArmId]] <- fillingLevel

# TODO increment also factor and strata levels
# TODO increment also factor and strata levels (https://github.com/RCONIS/randomforge/issues/8)
},
setFillingLevelsBlock = function(randomBlock) {
factorLevels <- randomBlock$factorLevels
Expand Down
4 changes: 2 additions & 2 deletions R/f_random_service.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ getNextRandomResult <- function(
randomSystemState <- RandomSystemState()
randomSystemState$init(randomConfiguration$treatmentArmIds,
factorIds = randomConfiguration$factorIds,
strataIds = NULL # TODO implement strataIds
strataIds = NULL # TODO implement strataIds (https://github.com/RCONIS/randomforge/issues/4)
)
}
if (is.null(randomSystemState)) {
stop("Failed to get random system state")
}

factorLevels <- list() # TODO implement factorLevels
factorLevels <- list() # TODO implement factorLevels (https://github.com/RCONIS/randomforge/issues/4)

randomResult <- randomMethod$randomize(factorLevels, randomSystemState, randomAllocationValue)
randomDataBase$persist(randomResult)
Expand Down