Description Usage Arguments Value Examples
Plot the Expected Running Time (ERT) functions for a couple of different datasets.
1 2 3 4 5 6 7 8 9 | ## S3 method for class 'func.ert'
plot(x, goal.dim = 2L, time.dim = 1L,
time.type = as.integer, goal.type = as.numeric,
goal.min = goal.type(NA_real_), goal.max = goal.type(NA_real_),
time.max = time.type(NA_real_), extract.run = identity,
extract.runs = identity, comparator = `<=`,
lineTypeFun = lineTypes.distinct, colorFun = colors.distinct,
goal.markers = c(0.2, 0.4, 0.6, 0.8), time.markers = NULL,
legend = NULL, legend.pos = "bottomleft", legend.cex = NA, ...)
|
x |
the data, maybe a list of [lists of matrices or a list of
vectors/lists], where each element has at least the |
goal.dim |
the dimension where where the goal values can be found |
time.dim |
the dimension where the time values can be found |
time.type |
the type function the time dimension, should be
|
goal.type |
the type function the goal dimension, should be
|
goal.min |
the minimum goal value or |
goal.max |
the maximum goal value or |
time.max |
the maximum time value to be used, or |
extract.run |
a function which can be used to extract the single runs
from the run sets, e.g., |
extract.runs |
a function which can be used to extract the run sets from
|
comparator |
the comparator, usually |
lineTypeFun |
the line type function, a function returning the line types to use for a provided number of inputs |
colorFun |
the colors function, a function returning the color list to use for a provided number of inputs |
goal.markers |
markers for the goal values |
time.markers |
markers for the time values |
legend |
the legend names |
legend.pos |
the legend position (optional, default: bottomleft) |
legend.cex |
the character sizing for the legend, optional, default
|
... |
Arguments passed on to
|
a list(x=c(goal.min, goal.max), y=c(time.min, time.max))
of
the minimum and maximum time and goal values encountered
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | library("plotteR");
set.seed(10000L);
# create a single run
make.run <- function(q.best, time.worst, ...) {
repeat {
x <- sort(unique(as.integer(c(1L, time.worst, runif(n=19L, min=1L, max=time.worst)))));
if(length(x) == 21L) { break; }
}
range <- 1 - q.best;
repeat {
l <- unique((exp(runif(n=20L, min=1L, max=5L))-exp(1L))/exp(5L));
if(length(l) != 20L) { next; }
if(any((l<=0) | (l >= 1))) { next; }
y <- sort(unique(c(q.best, q.best + (range*l))), decreasing = TRUE);
if(length(y) == 21L) { break; }
}
return(matrix(c(x, y), ncol=2L))
}
# make n runs
make.runs <- function(n, q.best, time.worst) {
return(lapply(X=seq_len(n), FUN=make.run, q.best=q.best, time.worst=time.worst));
}
# plot five example ERTs
plot.func.ert(x = list(make.runs(20, 0.0, 1e6),
make.runs(20, 0.5, 1e6),
make.runs(20, 0.0, 1e4),
make.runs(20, 0.5, 1e4),
make.runs(20, 0.1, 1e5)),
legend=c("slow+good", "slow+bad", "fast+good", "fast+bad", "ok+ok"),
log="y",
time.max=1e6,
goal.min=0,
goal.max=1,
goal.markers = c(0.1, 0.5),
time.markers = c(1e6, 1e4, 1e5));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.