ParamHelpers
ParamHelpers copied to clipboard
ploting: getOptPathColAtTimes
Before it gets lost - here something which might contribute to plotting. Why do we need it? I needed it because
- Comparing different opt.paths
- Averaging opt.paths at a given time
getOptPathColAtTimes = function(op, times) {
if (!is.data.frame(op))
op = as.data.frame(op)
assertNumeric(op$exec.time)
op$exec.time.sum = cumsum(op$env$exec.time)
op$finished = c(rep(FALSE, times = nrow(op) - 1), TRUE)
adply(times, 1, getOptPathColAtTime, op = op)
}
getOptPathColAtTime = function(op.df, time) {
col = op.df[which.last(op.df$exec.time.sum<=time), ]
if (nrow(col) == 1) col$time = time
col
}
We have a good plot-function for a single opt.path now. Do we need plot-functions for comparing multiple opt.paths?
I will add the EAF-function today, so we have a function to compare multiplie multi-crit opt.paths. Do we need something similar for single-crit? What would we want to see in such plots? Plot average y-value versus time? As a line-plot?
I have added functions plot and renderYTrace: They take a list of opt.paths and plot a lineplot. On the y-axis the values of the y-variable are plotted, on the x-axis either the dob or the cumulated exec.time (using Jakobs functions).
As for the EAFs, do we need a nice example here?
@jakob-r I find this resaonable and good. please do a PR for this. Try to look and daniels code and reuse it, if somehow possible.
OK?
I mean plotYTraces