pyglobalsearch.PyLocalSolution#
- class pyglobalsearch.PyLocalSolution(point, objective)#
Bases:
objectA local solution found by the optimization algorithm.
Represents a single solution point in parameter space along with its objective function value. This class provides both direct attribute access and SciPy-compatible methods for accessing solution data.
- Variables:
Examples#
Create and access a solution:
>>> solution = PyLocalSolution([1.0, 2.0], 3.5) >>> # Access via attributes >>> x_coords = solution.point >>> f_value = solution.objective >>> # Access via SciPy-compatible methods >>> x_coords = solution.x() >>> f_value = solution.fun()
- __init__()#
Methods
__init__()fun()Returns the objective function value at the solution point.
x()Returns the solution point as a list of float values.
Attributes
The objective function value at this solution point
The solution coordinates as a list of float values
- fun()#
Returns the objective function value at the solution point.
- Returns:
The objective function value at this solution point (same as objective attribute)
- Return type:
Note
This method is similar to the fun method in SciPy.optimize results.
- objective#
The objective function value at this solution point
- Returns:
The objective function value at this solution point (same as fun() method)
- Return type:
- point#
The solution coordinates as a list of float values