Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gensa update breaks #214

Closed
mb706 opened this issue Dec 6, 2023 · 2 comments
Closed

gensa update breaks #214

mb706 opened this issue Dec 6, 2023 · 2 comments

Comments

@mb706
Copy link
Contributor

mb706 commented Dec 6, 2023

The example in the README.md uses GenSA but fails with the very new version that will probably end up on CRAN soon:

> library("bbotk")
Loading required package: paradox
> fun = function(xs) {
  - (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 object
objective = ObjectiveRFun$new(
  fun = fun,
  domain = domain,
  codomain = codomain,
  properties = "deterministic"
)

# Define termination criterion
terminator = trm("evals", n_evals = 10)

# create optimization instance
instance = OptimInstanceSingleCrit$new(
  objective = objective,
  terminator = terminator
)

# load optimizer
optimizer = opt("gensa")

# trigger optimization
optimizer$optimize(instance)
INFO  [13:49:59.346] [bbotk] Starting to optimize 2 parameter(s) with '<OptimizerGenSA>' and '<TerminatorEvals> [n_evals=10, k=0]'
Error in GenSA::GenSA(par = NULL, fn = inst$objective_function, lower = inst$search_space$lower,  : 
  Trace mat has to be activated to have no improvment stop criteria to work.

the gensa 1.1.11 found here: https://cran.r-project.org/incoming/archive/

@mb706
Copy link
Contributor Author

mb706 commented Dec 6, 2023

problem is this

param_set$values$trace.mat = FALSE # we don't need this

@be-marc
Copy link
Member

be-marc commented Dec 12, 2023

Thanks. Fixed by #215.

@be-marc be-marc closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants