# create a registry and add problems and algorithms
reg = makeExperimentRegistry("getIndex", file.dir = tempfile(""))
addProblem(reg, "prob", static = 1)
addAlgorithm(reg, "f0", function(static, dynamic) static)
addAlgorithm(reg, "f1", function(static, dynamic, i, k) static * i^k)
ad = list(makeDesign("f0"), makeDesign("f1", exhaustive = list(i = 1:10, k = 1:3)))
addExperiments(reg, algo.designs = ad)
submitJobs(reg)
# get grouped job ids
ids = getJobIds(reg)
by(ids, getIndex(reg, by.prob = TRUE, by.algo = TRUE), identity)
ids.f1 = findExperiments(reg, algo.pattern = "f1")
by(ids.f1, getIndex(reg, ids.f1, by.algo.pars = (k == 1)), identity)
# groupwise reduction
ids.f1 = findExperiments(reg, algo.pattern = "f1")
f = function(aggr, job, res) aggr + res
by(ids.f1, getIndex(reg, ids.f1, by.algo.pars = k), reduceResults, reg = reg, fun = f)
by(ids.f1, getIndex(reg, ids.f1, by.algo.pars = i), reduceResults, reg = reg, fun = f)Run the code above in your browser using DataLab