/** * {@inheritDoc} */ public PointValuePair optimize(int maxEval, final FUNC f, final GoalType goal, double[] startPoint) { maxEvaluations = maxEval; RuntimeException lastException = null; optima = new PointValuePair[starts]; totalEvaluations = 0; // Multi-start loop. for (int i = 0; i < starts; ++i) { // CHECKSTYLE: stop IllegalCatch try { optima[i] = optimizer.optimize(maxEval - totalEvaluations, f, goal, i == 0 ? startPoint : generator.nextVector()); } catch (RuntimeException mue) { lastException = mue; optima[i] = null; } // CHECKSTYLE: resume IllegalCatch totalEvaluations += optimizer.getEvaluations(); } sortPairs(goal); if (optima[0] == null) { throw lastException; // cannot be null if starts >=1 } // Return the found point given the best objective function value. return optima[0]; }
i == 0 ? startPoint : generator.nextVector()); } catch (ConvergenceException oe) { optima[i] = null;
throw new TooManyEvaluationsException(getMaxEvaluations()); s = generator.nextVector(); for (int k = 0; s != null && k < s.length; ++k) { if ((min != null && s[k] < min[k]) || (max != null && s[k] > max[k])) {
/** * {@inheritDoc} */ public PointValuePair optimize(int maxEval, final FUNC f, final GoalType goal, double[] startPoint) { maxEvaluations = maxEval; RuntimeException lastException = null; optima = new PointValuePair[starts]; totalEvaluations = 0; // Multi-start loop. for (int i = 0; i < starts; ++i) { // CHECKSTYLE: stop IllegalCatch try { optima[i] = optimizer.optimize(maxEval - totalEvaluations, f, goal, i == 0 ? startPoint : generator.nextVector()); } catch (RuntimeException mue) { lastException = mue; optima[i] = null; } // CHECKSTYLE: resume IllegalCatch totalEvaluations += optimizer.getEvaluations(); } sortPairs(goal); if (optima[0] == null) { throw lastException; // cannot be null if starts >=1 } // Return the found point given the best objective function value. return optima[0]; }
i == 0 ? startPoint : generator.nextVector()); } catch (ConvergenceException oe) { optima[i] = null;
throw new TooManyEvaluationsException(getMaxEvaluations()); s = generator.nextVector(); for (int k = 0; s != null && k < s.length; ++k) { if ((min != null && s[k] < min[k]) || (max != null && s[k] > max[k])) {
throw new TooManyEvaluationsException(getMaxEvaluations()); s = generator.nextVector(); for (int k = 0; s != null && k < s.length; ++k) { if ((min != null && s[k] < min[k]) || (max != null && s[k] > max[k])) {