simopt.solvers.strong ===================== .. py:module:: simopt.solvers.strong .. autoapi-nested-parse:: STRONG Solver. STRONG: A trust-region-based algorithm that fits first- or second-order models through function evaluations taken within a neighborhood of the incumbent solution. A detailed description of the solver can be found `here `__. Module Contents --------------- .. py:class:: STRONGConfig Bases: :py:obj:`simopt.base.SolverConfig` Configuration for STRONG solver. .. py:attribute:: n0 :type: Annotated[int, Field(default=10, gt=0, description='initial sample size')] .. py:attribute:: n_r :type: Annotated[int, Field(default=10, gt=0, description='number of replications taken at each solution')] .. py:attribute:: sensitivity :type: Annotated[float, Field(default=1e-07, gt=0, description='shrinking scale for VarBds')] .. py:attribute:: delta_threshold :type: Annotated[float, Field(default=1.2, gt=0, description='maximum value of the radius')] .. py:attribute:: delta_t :type: Annotated[float, Field(default=2.0, description='initial size of trust region', alias='delta_T')] .. py:attribute:: eta_0 :type: Annotated[float, Field(default=0.01, gt=0, lt=1, description='constant for accepting')] .. py:attribute:: eta_1 :type: Annotated[float, Field(default=0.3, lt=1, description='constant for more confident accepting')] .. py:attribute:: gamma_1 :type: Annotated[float, Field(default=0.9, gt=0, lt=1, description='constant for shrinking the trust region')] .. py:attribute:: gamma_2 :type: Annotated[float, Field(default=1.11, gt=1, description='constant for expanding the trust region')] .. py:attribute:: lambda_ :type: Annotated[int, Field(default=2, gt=1, alias='lambda', description='magnifying factor for n_r in finite difference function')] .. py:attribute:: lambda_2 :type: Annotated[float, Field(default=1.01, gt=1, description='magnifying factor for n_r in stage I and stage II (>1)')] .. py:class:: STRONG(name: str = '', fixed_factors: dict | None = None) Bases: :py:obj:`simopt.base.Solver` STRONG Solver. A trust-region-based algorithm that fits first- or second-order models through function evaluations taken within a neighborhood of the incumbent solution. Initialize a solver object. :param name: Name of the solver. Defaults to an empty string. :type name: str, optional :param fixed_factors: Dictionary of user-specified solver factors. Defaults to None. :type fixed_factors: dict | None, optional .. py:attribute:: name :type: str :value: 'STRONG' .. py:attribute:: config_class :type: ClassVar[type[simopt.base.SolverConfig]] Configuration class for the solver. .. py:attribute:: class_name_abbr :type: ClassVar[str] :value: 'STRONG' Short name of the solver class. .. py:attribute:: class_name :type: ClassVar[str] :value: 'STRONG' Long name of the solver class. .. py:attribute:: objective_type :type: ClassVar[simopt.base.ObjectiveType] Description of objective types. .. py:attribute:: constraint_type :type: ClassVar[simopt.base.ConstraintType] Description of constraint types. .. py:attribute:: variable_type :type: ClassVar[simopt.base.VariableType] Description of variable types. .. py:attribute:: gradient_needed :type: ClassVar[bool] :value: False True if gradient of objective function is needed, otherwise False. .. py:method:: solve(problem: simopt.base.Problem) -> None Run a single macroreplication of a solver on a problem. :param problem: Simulation-optimization problem to solve. :type problem: Problem :returns: - list [Solution]: List of solutions recommended throughout the budget. - list [int]: List of intermediate budgets when recommended solutions change. :rtype: tuple .. py:method:: cauchy_point(grad: numpy.ndarray, hessian: numpy.ndarray, new_x: numpy.ndarray, problem: simopt.base.Problem) -> numpy.ndarray Find the Cauchy point based on the gradient and Hessian matrix. .. py:method:: check_cons(candidate_x: tuple, new_x: tuple | numpy.ndarray, lower_bound: tuple, upper_bound: tuple) -> numpy.ndarray Check feasibility of a new point and apply Cauchy point correction if needed. This method compares a candidate point to its updated version and enforces box constraints defined by lower and upper bounds. :param candidate_x: Current decision variable vector (the Cauchy point). :type candidate_x: tuple :param new_x: Proposed new solution to check and correct. :type new_x: tuple | np.ndarray :param lower_bound: Lower bounds for each decision variable. :type lower_bound: tuple :param upper_bound: Upper bounds for each decision variable. :type upper_bound: tuple :returns: The corrected feasible solution, clipped to respect the bounds. :rtype: np.ndarray