主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

list

列出起点

说明

points = list(tpoints) 返回 tpoints CustomStartPointSet 对象内部的点。

示例

points = list(rs,problem) 生成并返回由 rs RandomStartPointSet 对象和 problem 描述的点。

示例

示例

全部折叠

创建一个具有 64 个三维点的 CustomStartPointSet 对象。

[x,y,z] = meshgrid(1:4);
ptmatrix = [x(:),y(:),z(:)] + [10,20,30];
tpoints = CustomStartPointSet(ptmatrix);

tpointsptmatrix 对象中包含的 CustomStartPointSet 矩阵。

使用 tpointslist 对象中提取原始矩阵。

tpts = list(tpoints);

检查 tpts 输出是否与 ptmatrix 相同。

isequal(ptmatrix,tpts)
ans = logical
   1

创建一个 40 分的 RandomStartPointSet 对象。

rs = RandomStartPointSet(NumStartPoints=40);

创建一个具有 3-D 变量、下界为 0、上界为 [10,20,30] 的问题。

problem = createOptimProblem("fmincon",x0=rand(3,1),lb=zeros(3,1),ub=[10,20,30]);

生成一组与问题一致的随机点,共 40 个。

points = list(rs,problem);

检查最大和最小生成的分量。

largest = max(max(points))
largest = 
29.8840
smallest = min(min(points))
smallest = 
0.1390

输入参数

全部折叠

起点,指定为 CustomStartPointSet 对象。list 将点提取到一个矩阵中,其中每行是一个起点。

示例: tpoints = CustomStartPointSet([1:5;4:8].^2)

起点描述,指定为 RandomStartPointSet 对象。list 使用 NumStartPointsArtificialBound(点数)和 rs(人工边界)属性生成起点。list 使用 x0 中的 problem 字段来确定起点中的变量数。list 使用 problem 中的边界,如下所示:

  • list 在边界内均匀生成点。

  • 如果分量没有边界,则 list 使用 -ArtificialBound 的下界和 ArtificialBound 的上界。

  • 如果某个分量有下界 lb 但没有上界,则 list 使用上界 lb + 2*ArtificialBound

  • 类似地,如果一个分量有上界 ub 但没有下界,则 list 使用下界 ub - 2*ArtificialBound

问题描述,指定为问题结构体。使用 createOptimProblem 创建问题结构体。list 仅使用 problem 中的下界和上界(如 rs 中所述),并使用 x0 中的 problem 字段来确定变量的数量。

数据类型: struct

输出参量

全部折叠

起点,以 k×n 矩阵的形式返回。矩阵的每一行代表一个起点。

  • 如果列出 CustomStartPointSet,那么 k 就是 NumStartPoints 属性,而 n 就是 StartPointsDimension 属性。

  • 如果列出 RandomStartPointSet,那么 k 就是 NumStartPoints 属性,而 n 则是从 x0 结构体的 problem 字段推断出来的。

版本历史记录

在 R2010a 中推出