Displaying 2 results from an estimated 2 matches for "usestream".
2012 Jan 13
0
Example of "task seeds" with R parallel. Critique?
...seed
## currentSeeds = for each stream, a seed recording stream's current position
## currentStream = integer indicator of which stream is in use
## Test that interactively
currentStream <- 1
currentSeeds <- startSeeds <- projSeeds[[1]]
.Random.seed <- startSeeds[[currentStream]]
useStream <- function(n = NULL, origin = FALSE){
if (n > length(currentSeeds)) stop("requested stream does not exist")
currentSeeds[[currentStream]] <- .Random.seed
if (origin) assign(".Random.seed", startSeeds[[n]], envir = .GlobalEnv)
else assign(".Random.seed"...
2012 Feb 17
3
portable parallel seeds project: request for critiques
...ization function runs that loads the
seeds file and takes the row of seeds that it needs. As the
simulation progresses, the user can ask for random numbers from the
separate streams. When we need random draws from a particular stream,
we set the variable "currentStream" with the function useStream().
The function initSeedStreams creates several objects in
the global environment. It sets the integer currentStream,
as well as two list objects, startSeeds and currentSeeds.
At the outset of the run, startSeeds and currentSeeds
are the same thing. When we change the currentStream
to a different...