Threshold-Accepting Information
The function can be called from the objective and neighbourhood
function during a run of TAopt
; it provides information
such as the current iteration, the current solution, etc.
TA.info(n = 0L)
n |
generational offset; see Details. |
This function is still experimental.
The function can be called in the neighbourhood function or the
objective function during a run of TAopt
. It evaluates
to a list with the state of the optimisation run, such as the current
iteration.
TA.info
relies on parent.frame
to retrieve its
information. If the function is called within another function in the
neighbourhood or objective function, the argument n
needs to be
increased.
A list
OF.sampling |
logical: if |
iteration |
current iteration |
step |
current step (i.e. for a given threshold) |
threshold |
current threshold (the number, not the value) |
xbest |
the best solution found so far |
OF.xbest |
objective function value of best solution |
Enrico Schumann
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. https://www.elsevier.com/books/numerical-methods-and-optimization-in-finance/gilli/978-0-12-815065-8
Schumann, E. (2019) Financial Optimisation with R (NMOF Manual). http://enricoschumann.net/NMOF.htm#NMOFmanual
### MINIMAL EXAMPLE for TAopt ## objective function evaluates to a constant fun <- function(x) 0 ## neighbourhood function does not even change the solution, ## but it reports information nb <- function(x) { tmp <- TA.info() cat("current threshold ", tmp$threshold, "| current step ", tmp$step, "| current iteration ", tmp$iteration, "\n") x } ## run TA algo <- list(nS = 5, nT = 2, nD = 3, x0 = rep(0, 5), neighbour = nb, printBar = FALSE, printDetail = FALSE) ignore <- TAopt(fun, algo) ## printed output: ## current threshold NA | current step 1 | current iteration NA ## current threshold NA | current step 2 | current iteration NA ## current threshold NA | current step 3 | current iteration NA ## current threshold 1 | current step 1 | current iteration 1 ## current threshold 1 | current step 2 | current iteration 2 ## current threshold 1 | current step 3 | current iteration 3 ## current threshold 1 | current step 4 | current iteration 4 ## current threshold 1 | current step 5 | current iteration 5 ## current threshold 2 | current step 1 | current iteration 6 ## current threshold 2 | current step 2 | current iteration 7 ## current threshold 2 | current step 3 | current iteration 8 ## current threshold 2 | current step 4 | current iteration 9 ## current threshold 2 | current step 5 | current iteration 10
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.