simopt.solvers.randomsearch =========================== .. py:module:: simopt.solvers.randomsearch .. autoapi-nested-parse:: Random Search Solver. Randomly sample solutions from the feasible region. Can handle stochastic constraints. A detailed description of the solver can be found `here `__. Module Contents --------------- .. py:class:: RandomSearchConfig Bases: :py:obj:`simopt.base.SolverConfig` Configuration for Random Search solver. .. py:attribute:: sample_size :type: Annotated[int, Field(default=10, gt=0, description='sample size per solution')] .. py:class:: RandomSearch(name: str = '', fixed_factors: dict | None = None) Bases: :py:obj:`simopt.base.Solver` Random Search Solver. A solver that randomly samples solutions from the feasible region. Take a fixed number of replications at each 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: 'RNDSRCH' .. py:attribute:: config_class :type: ClassVar[type[simopt.base.SolverConfig]] Configuration class for the solver. .. py:attribute:: class_name_abbr :type: ClassVar[str] :value: 'RNDSRCH' Short name of the solver class. .. py:attribute:: class_name :type: ClassVar[str] :value: 'Random Search' 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