ArchiveAsyncFrozen: Frozen Rush Data Storage

ArchiveAsyncFrozenR Documentation

Frozen Rush Data Storage

Description

Freezes the Redis data base of an ArchiveAsync to a data.table::data.table(). No further points can be added to the archive but the data can be accessed and analyzed. Useful when the Redis data base is not permanently available. Use the callback bbotk.async_freeze_archive to freeze the archive after the optimization has finished.

S3 Methods

  • as.data.table(archive)
    ArchiveAsync -> data.table::data.table()
    Returns a tabular view of all performed function calls of the Objective. The x_domain column is unnested to separate columns.

Super classes

Archive -> ArchiveAsync -> ArchiveAsyncFrozen

Active bindings

data

(data.table::data.table)
Data table with all finished points.

queued_data

(data.table::data.table)
Data table with all queued points.

running_data

(data.table::data.table)
Data table with all running points.

finished_data

(data.table::data.table)
Data table with all finished points.

failed_data

(data.table::data.table)
Data table with all failed points.

n_queued

(integer(1))
Number of queued points.

n_running

(integer(1))
Number of running points.

n_finished

(integer(1))
Number of finished points.

n_failed

(integer(1))
Number of failed points.

n_evals

(integer(1))
Number of evaluations stored in the archive.

Methods

Public methods

Inherited methods

ArchiveAsyncFrozen$new()

Creates a new instance of this R6 class.

Usage
ArchiveAsyncFrozen$new(archive)
Arguments
archive

(ArchiveAsync)
The archive to freeze.


ArchiveAsyncFrozen$push_points()

Push queued points to the archive.

Usage
ArchiveAsyncFrozen$push_points(xss, xss_extra = NULL)
Arguments
xss

(list of named list())
List of named lists of point values.

xss_extra

(list of named list() | NULL)
List of named lists of additional information.


ArchiveAsyncFrozen$push_point()

Push a single queued point to the archive.

Usage
ArchiveAsyncFrozen$push_point(xs, xs_extra = NULL)
Arguments
xs

(named list())
Named list of point values.

xs_extra

(named list() | NULL)
Named list of additional information.


ArchiveAsyncFrozen$push_running_points()

Push running points to the archive.

Usage
ArchiveAsyncFrozen$push_running_points(xss, xss_extra = NULL)
Arguments
xss

(list of named list())
List of named lists of point values.

xss_extra

(list of named list() | NULL)
List of named lists of additional information.


ArchiveAsyncFrozen$push_running_point()

Push running point to the archive.

Usage
ArchiveAsyncFrozen$push_running_point(xs, xs_extra = NULL)
Arguments
xs

(named list())
Named list of point values.

xs_extra

(named list() | NULL)
Named list of additional information.


ArchiveAsyncFrozen$push_finished_points()

Push finished points to the archive.

Usage
ArchiveAsyncFrozen$push_finished_points(
  xss,
  yss,
  xss_extra = NULL,
  yss_extra = NULL
)
Arguments
xss

(list of named list())
List of named lists of point values.

yss

(list of named list())
List of named lists of results.

xss_extra

(list of named list() | NULL)
List of named lists of additional information.

yss_extra

(list of named list() | NULL)
List of named lists of additional information.


ArchiveAsyncFrozen$push_finished_point()

Push a single finished point to the archive.

Usage
ArchiveAsyncFrozen$push_finished_point(
  xs,
  ys,
  xs_extra = NULL,
  ys_extra = NULL
)
Arguments
xs

(named list())
Named list of point values.

ys

(named list())
Named list of results.

xs_extra

(⁠named list()⁠ | NULL)
Named list of additional information.

ys_extra

(⁠named list()⁠ | NULL)
Named list of additional information.


ArchiveAsyncFrozen$push_failed_points()

Push failed points to the archive.

Usage
ArchiveAsyncFrozen$push_failed_points(xss, xss_extra = NULL, conditions = NULL)
Arguments
xss

(list of named list())
List of named lists of point values.

xss_extra

(list of named list() | NULL)
List of named lists of additional information.

conditions

(list | NULL)
List of conditions for each failed point. If NULL, a generic error message is used.


ArchiveAsyncFrozen$push_failed_point()

Push a single failed point to the archive.

Usage
ArchiveAsyncFrozen$push_failed_point(xs, xs_extra = NULL, condition = NULL)
Arguments
xs

(named list())
Named list of point values.

xs_extra

(⁠named list()⁠ | NULL)
Named list of additional information.

condition

(any | NULL)
Condition of the failed point. If NULL, a generic error message is used.


ArchiveAsyncFrozen$pop_point()

Pop a point from the queue.

Usage
ArchiveAsyncFrozen$pop_point()

ArchiveAsyncFrozen$finish_points()

Save the results of multiple running points and move them to the finished points.

Usage
ArchiveAsyncFrozen$finish_points(keys, yss, x_domains, yss_extra = NULL)
Arguments
keys

(character())
Keys of the points.

yss

(list of named list())
List of named lists of results.

x_domains

(list())
List of named lists of transformed point values.

yss_extra

(list of named list() | NULL)
List of named lists of additional information.


ArchiveAsyncFrozen$finish_point()

Save the results of a running point and move it to the finished points.

Usage
ArchiveAsyncFrozen$finish_point(key, ys, x_domain, ys_extra = NULL)
Arguments
key

(character(1))
Key of the point.

ys

(named list())
Named list of results.

x_domain

(named list())
Named list of transformed point values.

ys_extra

(named list() | NULL)
Named list of additional information.


ArchiveAsyncFrozen$fail_points()

Move multiple running points to the failed points.

Usage
ArchiveAsyncFrozen$fail_points(keys, conditions = NULL)
Arguments
keys

(character())
Keys of the points.

conditions

(list() | NULL)
Conditions of the failed points.


ArchiveAsyncFrozen$fail_point()

Move a running point to the failed points.

Usage
ArchiveAsyncFrozen$fail_point(key, condition = NULL)
Arguments
key

(character(1))
Key of the point.

condition

(any | NULL)
Condition of the failed point.


ArchiveAsyncFrozen$push_result()

Deprecated. Use ⁠$finish_point()⁠ instead.

Usage
ArchiveAsyncFrozen$push_result(key, ys, x_domain, extra = NULL)
Arguments
key

(character())
Key of the point.

ys

(list())
Named list of results.

x_domain

(list())
Named list of transformed point values.

extra

(list())
Named list of additional information.


ArchiveAsyncFrozen$data_with_state()

Fetch points with a specific state.

Usage
ArchiveAsyncFrozen$data_with_state(
  fields = c("xs", "ys", "xs_extra", "worker_extra", "ys_extra", "condition"),
  states = c("queued", "running", "finished", "failed"),
  reset_cache = FALSE
)
Arguments
fields

(character())
Fields to fetch. Defaults to c("xs", "ys", "xs_extra", "worker_extra", "ys_extra").

states

(character())
States of the tasks to be fetched. Defaults to c("queued", "running", "finished", "failed").

reset_cache

(logical(1))
Whether to reset the cache of the finished points.


ArchiveAsyncFrozen$clear()

Clear all evaluation results from archive.

Usage
ArchiveAsyncFrozen$clear()

ArchiveAsyncFrozen$clone()

The objects of this class are cloneable with this method.

Usage
ArchiveAsyncFrozen$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

ArchiveAsync

Examples

# example only runs if a Redis server is available
if (mlr3misc::require_namespaces(c("rush", "redux", "mirai"), quietly = TRUE) &&
  redux::redis_available()) {
# define the objective function
fun = function(xs) {
  list(y = - (xs[[1]] - 2)^2 - (xs[[2]] + 3)^2 + 10)
}

# set domain
domain = ps(
  x1 = p_dbl(-10, 10),
  x2 = p_dbl(-5, 5)
)

# set codomain
codomain = ps(
  y = p_dbl(tags = "maximize")
)

# create objective
objective = ObjectiveRFun$new(
  fun = fun,
  domain = domain,
  codomain = codomain,
  properties = "deterministic"
)

# start workers
rush::rush_plan(worker_type = "mirai")
mirai::daemons(1)

# initialize instance
instance = oi_async(
  objective = objective,
  terminator = trm("evals", n_evals = 20),
  callback = clbk("bbotk.async_freeze_archive")
)

# load optimizer
optimizer = opt("async_random_search")

# trigger optimization
optimizer$optimize(instance)

# frozen archive
instance$archive

# best performing configuration
instance$archive$best()

# covert to data.table
as.data.table(instance$archive)
}

bbotk documentation built on July 17, 2026, 5:07 p.m.