Skip to content

getNextRandomResult(): implement strataIds and factorLevels #4

@fpahlke

Description

@fpahlke

In getNextRandomResult() the following features need to be implemented:

# get previous random system state
randomSystemState <- NULL 
lastSubject <- randomDataBase$getLastSubject(randomProject)
if (!is.null(lastSubject)) {
    if (is.null(lastSubject$randomResult)) {
        stop("'randomResult' of subject ", lastSubject$toString(), " does not exist")
    }
    randomSystemState <- lastSubject$randomResult$randomSystemState$clone()
} else {
    randomSystemState <- RandomSystemState()
    randomSystemState$init(randomConfiguration$treatmentArmIds, 
        factorIds = randomConfiguration$factorIds, 
        strataIds = NULL # TODO implement strataIds
    )
}
if (is.null(randomSystemState)) {
    stop("Failed to get random system state")
}

factorLevels <- list() # TODO implement factorLevels

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions