Set Start Points for MultiStart
Four Ways to Set Start Points
There are four ways you tellMultiStart
which start points to use for the local solver:
Pass apositive integer
k
.MultiStart
generatesk - 1
start points as if using aRandomStartPointSet
object and theproblem
structure.MultiStart
also uses thex0
start point from theproblem
structure, for a total ofk
start points.Pass a
RandomStartPointSet
object.Pass a
CustomStartPointSet
object.Pass acell arrayof
RandomStartPointSet
andCustomStartPointSet
objects. Pass a cell array if you have some specific points you want to run, but also wantMultiStart
to use other random start points.
Note
You can control whetherMultiStart
uses all start points, or only those points that satisfy bounds or other inequality constraints. For more information, seeFilter Start Points (Optional).
Positive Integer for Start Points
The syntax for runningMultiStart
fork
start points is
[xmin,fmin,flag,outpt,allmins] = run(ms,problem,k);
The positive integerk
specifies the number of start pointsMultiStart
uses.MultiStart
generates random start points using the dimension of the problem and bounds from theproblem
structure.MultiStart
generatesk - 1
random start points, and also uses thex0
start point from theproblem
structure.
RandomStartPointSet Object for Start Points
Create aRandomStartPointSet
object as follows:
stpoints = RandomStartPointSet;
RunMultiStart
starting from aRandomStartPointSet
as follows:
[xmin,fmin,flag,outpt,allmins] = run(ms,problem,stpoints);
By default aRandomStartPointSet
object generates 10 start points. Control the number of start points with theNumStartPoints
property. For example, to generate 40 start points:
stpoints = RandomStartPointSet('NumStartPoints',40);
You can set anArtificialBound
for aRandomStartPointSet
. ThisArtificialBound
works in conjunction with the bounds from the problem structure:
If a component has no bounds,
RandomStartPointSet
uses a lower bound of-ArtificialBound
和一个上限的ArtificialBound
.If a component has a lower bound
lb
but no upper bound,RandomStartPointSet
uses an upper bound oflb + 2*ArtificialBound
.Similarly, if a component has an upper bound
ub
but no lower bound,RandomStartPointSet
uses a lower bound ofub - 2*ArtificialBound
.
For example, to generate100
start points with anArtificialBound
of50
:
stpoints = RandomStartPointSet('NumStartPoints', 100,...'ArtificialBound',50);
ARandomStartPointSet
object generates start points with the same dimension as thex0
point in the problem structure; seelist
.
CustomStartPointSet Object for Start Points
To use a specific set of starting points, package them in aCustomStartPointSet
as follows:
Place the starting points in a matrix. Each row of the matrix represents one starting point.
MultiStart
运行所有矩阵的行,过滤器ing with theStartPointsToRun
property. For more information, seeMultiStart Algorithm.Create a
CustomStartPointSet
object from the matrix:tpoints = CustomStartPointSet(ptmatrix);
For example, create a set of 40 five-dimensional points, with each component of a point equal to 10 plus an exponentially distributed variable with mean 25:
pts = -25*log(rand(40,5)) + 10; tpoints = CustomStartPointSet(pts);
RunMultiStart
starting from aCustomStartPointSet
as follows:
[xmin,fmin,flag,outpt,allmins] = run(ms,problem,tpoints);
To get the original matrix of points from aCustomStartPointSet
object, uselist
:
pts = list(tpoints);% Assumes tpoints is a CustomStartPointSet
ACustomStartPointSet
has two properties:StartPointsDimension
andNumStartPoints
. You can use these properties to query aCustomStartPointSet
object. For example, thetpoints
object in the example has the following properties:
tpoints.StartPointsDimension ans = 5 tpoints.NumStartPoints ans = 40
Cell Array of Objects for Start Points
To use a specific set of starting points along with some randomly generated points, pass a cell array ofRandomStartPointSet
orCustomStartPointSet
objects.
For example, to use both the 40 specific five-dimensional points ofCustomStartPointSet Object for Start Pointsand 40 additional five-dimensional points fromRandomStartPointSet
:
pts = -25*log(rand(40,5)) + 10; tpoints = CustomStartPointSet(pts); rpts = RandomStartPointSet('NumStartPoints',40); allpts = {tpoints,rpts};
RunMultiStart
starting from theallpts
cell array:
% Assume ms and problem exist[xmin,fmin,flag,outpt,allmins] = run(ms,problem,allpts);