R/Parallel.R

Defines functions load_parallel run_scenarios

## TODO!

load_parallel <- function() {
    if ( any(grepl(":parallel", search())) ) 
        return( TRUE )
    ## loaded <- require("parallel", quietly=TRUE)
    return( FALSE )
}

run_scenarios <- function(model, scenarios, cl=1L) {
    if ( is.numeric(cl) ) {
        if ( !load_parallel() ) stop("the 'parallel' package couldn't be found!")
        solution <- NULL
    } else if ( inherits(cl, "cluster") ) {

    } else {
        stop("'cl' must be 'integer' or object of type 'cluster'!")
    }
}

Try the ROML package in your browser

Any scripts or data that you put into this service are public.

ROML documentation built on May 2, 2019, 6:52 p.m.