non-Linear Programming Search
ScipySearch
Solver name is “Scipy”.
- class flopt.solvers.scipy_searches.ScipySearch[source]
scipy optimize minimize API Solver
- Parameters:
n_max_retry (int) – maximum number of retries to success the search
n_trial (int) – number of trials in scipy solver
should_continue_searching (bool) – if it is true, the searches continue to timelimit
calculate_jac_hess (bool) – if it is true, jac and hess is calculated and pass them into the solver, if it is possible
Examples
import flopt # Variables a = flopt.Variable("a", lowBound=-2, upBound=1, cat="Integer") b = flopt.Variable("b", lowBound=1, upBound=4, cat="Continuous") c = flopt.Variable("c", lowBound=0, upBound=3, cat="Continuous") # Problem prob = flopt.Problem() prob += a*a + a*b + b + c + 2 prob += a + b >= 2 prob += b - c == 3 prob.solve(solver="Scipy", msg=True) print(flopt.Value([a, b, c])) >>> [0, 2.9999999999999996, 0.0]
See also
scipy.optimize.minimize