diff --git a/R/class_random_block_size_randomizer.R b/R/class_random_block_size_randomizer.R index f2fb50e..2e568b9 100644 --- a/R/class_random_block_size_randomizer.R +++ b/R/class_random_block_size_randomizer.R @@ -107,7 +107,7 @@ 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) { if (length(values) == 0) { stop("Block size randomizer not initialized. Call initRandomValues() first") } @@ -115,6 +115,8 @@ RandomBlockSizeRandomizer <- setRefClass("RandomBlockSizeRandomizer", 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) diff --git a/R/class_random_method_pbr.R b/R/class_random_method_pbr.R index 7683899..a1d2c4e 100644 --- a/R/class_random_method_pbr.R +++ b/R/class_random_method_pbr.R @@ -189,10 +189,7 @@ RandomMethodPBR <- setRefClass("RandomMethodPBR", blockSize <- blockSizes[[randomIndex]] - # TODO logging - # Map rndLoggerValues = new HashMap() - # 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) } diff --git a/R/class_random_method_range_set.R b/R/class_random_method_range_set.R index 09c3c2b..5df111f 100644 --- a/R/class_random_method_range_set.R +++ b/R/class_random_method_range_set.R @@ -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() diff --git a/R/class_random_system_state.R b/R/class_random_system_state.R index 8b07780..a7cdd4b 100644 --- a/R/class_random_system_state.R +++ b/R/class_random_system_state.R @@ -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 diff --git a/R/f_random_service.R b/R/f_random_service.R index 6ce8b7d..1add88a 100644 --- a/R/f_random_service.R +++ b/R/f_random_service.R @@ -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)