use of org.apache.commons.math3.optim.nonlinear.scalar.noderiv.BOBYQAOptimizer in project engineblock by engineblock.
the class BobyqaOptimizerInstance method optimize.
public MVResult optimize() {
initialGuess = initialGuess == null ? computeInitialGuess() : initialGuess;
bounds = bounds == null ? computeBounds() : bounds;
interpolations = interpolations == 0 ? getMinInterpolations() : interpolations;
BOBYQAOptimizer mo = new BOBYQAOptimizer(this.interpolations, this.initialTrustRegionRadius, this.stoppingTrustRegionRadius);
this.mvLogger = new MVLogger(this.objectiveScriptObject);
ObjectiveFunction objective = new ObjectiveFunction(this.mvLogger);
List<OptimizationData> od = List.of(objective, GoalType.MAXIMIZE, this.initialGuess, new MaxEval(this.maxEval), this.bounds);
this.result = mo.optimize(od.toArray(new OptimizationData[0]));
return new MVResult(this.result.getPoint(), this.params, this.mvLogger.getLogArray());
}
Aggregations