1%feature("docstring") OT::MultiStart
2"Multi-start optimization algorithm.
3
4The algorithm runs an optimization solver for multiple starting points and returns the
5best result of each local search.
6The algorithm succeeds when at least one local search succeeds.
7
8Parameters
9----------
10solver : :class:`~openturns.OptimizationAlgorithm`
11    The internal solver
12startingSample : 2-d sequence of float
13    Starting points set
14
15Notes
16-----
17A global number of evaluations can be explicitely set,
18in that case all starting points might not be used depending on the number
19of evaluations allocated to the internal solver.
20
21The starting point of *solver* is ignored.
22If you want to use it, add it to *startingSample*.
23
24Starting points provided through the *startingSample* parameter
25should be within the bounds of the
26:class:`~openturns.OptimizationProblem`, but this is not checked.
27
28Examples
29--------
30First define the :class:`~openturns.OptimizationAlgorithm` to be run from multiple starting points.
31
32>>> import openturns as ot
33>>> dim = 2
34>>> model = ot.SymbolicFunction(['x', 'y'], ['x^2+y^2*(1-x)^3'])
35>>> bounds = ot.Interval([-2.0] * dim, [3.0] * dim)
36>>> problem = ot.OptimizationProblem(model)
37>>> problem.setBounds(bounds)
38>>> solver = ot.TNC(problem)
39
40Starting points must be manually specified.
41
42>>> uniform = ot.ComposedDistribution([ot.Uniform(-2.0, 3.0)] * dim)
43>>> ot.RandomGenerator.SetSeed(0)
44>>> startingSample = uniform.getSample(5)
45>>> print(startingSample)
46    [ X0        X1        ]
470 : [  1.14938   2.84712  ]
481 : [  2.41403   2.6034   ]
492 : [ -1.32362   0.515201 ]
503 : [ -1.83749  -1.68397  ]
514 : [ -0.264715 -0.536216 ]
52>>> algo = ot.MultiStart(solver, startingSample)
53>>> algo.run()
54>>> result = algo.getResult()
55>>> print(result.getOptimalPoint())
56[3,3]"
57
58// ---------------------------------------------------------------------
59
60%feature("docstring") OT::MultiStart::getOptimizationAlgorithm
61"Internal solver accessor.
62
63Returns
64-------
65solver : :class:`~openturns.OptimizationAlgorithm`
66    The internal solver"
67
68// ---------------------------------------------------------------------
69
70%feature("docstring") OT::MultiStart::setOptimizationAlgorithm
71"Internal solver accessor.
72
73Parameters
74----------
75solver : :class:`~openturns.OptimizationAlgorithm`
76    The internal solver"
77
78// ---------------------------------------------------------------------
79
80%feature("docstring") OT::MultiStart::setStartingPoint
81"Inherited but raises an Exception.
82
83Notes
84-----
85This method is inherited from :class:`OptimizationAlgorithm` but makes
86no sense in a multi-start context."
87
88// ---------------------------------------------------------------------
89
90%feature("docstring") OT::MultiStart::getStartingPoint
91"Inherited but raises an Exception.
92
93Notes
94-----
95This method is inherited from :class:`OptimizationAlgorithm` but makes
96no sense in a multi-start context."
97
98// ---------------------------------------------------------------------
99
100%feature("docstring") OT::MultiStart::getStartingSample
101"Accessor to the sample of starting points."
102
103// ---------------------------------------------------------------------
104
105%feature("docstring") OT::MultiStart::setStartingSample
106"Accessor to the sample of starting points.
107
108Parameters
109----------
110startingSample : 2-d sequence of float
111    A new sample of starting points to overwrite the existing sample"
112
113// ---------------------------------------------------------------------
114
115%feature("docstring") OT::MultiStart::setKeepResults
116"Flag to keep intermediate results accessor.
117
118Parameters
119----------
120keepResults : bool
121    If *True* all the intermediate results are stored, otherwise they are ignored.
122    Default value is *MultiStart-KeepResults* in :class:`~openturns.ResourceMap`"
123
124// ---------------------------------------------------------------------
125
126%feature("docstring") OT::MultiStart::getKeepResults
127"Flag to keep intermediate results accessor.
128
129Returns
130-------
131keepResults : bool
132    If *True* all the intermediate results are stored, otherwise they are ignored.
133    Default value is *MultiStart-KeepResults* in :class:`~openturns.ResourceMap`"
134
135// ---------------------------------------------------------------------
136
137%feature("docstring") OT::MultiStart::getResultCollection
138"Intermediate optimization results accessor.
139
140Returns
141-------
142results : :class:`~openturns.OptimizationResultCollection`
143    Intermediate optimization results"
144
145// ---------------------------------------------------------------------
146
147%feature("docstring") OT::MultiStart::setProblem
148"Sets the optimization problem.
149
150Parameters
151----------
152problem : :class:`~openturns.OptimizationProblem`
153    Optimization problem."
154