主要内容

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

RandomStartPointSet

随机起点

说明

RandomStartPointSet 对象描述如何生成一组用于 MultiStart 的伪随机点。RandomStartPointSet 对象不包含点。它包含在 MultiStart 运行时或使用 list 函数时生成点的参数。

创建对象

描述

rs = RandomStartPointSet 创建一个默认的 RandomStartPointSet 对象。

示例

rs = RandomStartPointSet(PropertyName=Value)RandomStartPointSet 对象设置属性。例如,rs = RandomStartPointSet(NumStartPoints=50) 创建了一个使用 50 个起点的对象,而不是默认的 10 个。

示例

rs = RandomStartPointSet(oldrs,PropertyName=Value) 创建 oldrs RandomStartPointSet 对象的副本,并设置 rs 的属性。

示例

输入参量

全部展开

要更新的起点描述,指定为现有 RandomStartPointSet 对象。

输出参量

全部展开

随机起点描述,以 RandomStartPointSet 对象返回。描述 rs 使 MultiStartlist 能够创建起点。

属性

全部展开

无界分量的默认边界的绝对值,指定为正标量。

示例: 1e2

数据类型: double

起点的数量,指定为正整数。

示例: 40

数据类型: double

对象函数

list列出起点

示例

全部折叠

创建一个默认的 RandomStartPointSet 对象。

rs = RandomStartPointSet
rs = 
  RandomStartPointSet with properties:

     NumStartPoints: 10
    ArtificialBound: 1000

创建一个 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

创建一个生成 50 个点的 RandomStartPointSet 对象。

rs = RandomStartPointSet(NumStartPoints=50)
rs = 
  RandomStartPointSet with properties:

     NumStartPoints: 50
    ArtificialBound: 1000

更新 rs 以使用 100 个点和 1e4 的人工边界。

rs = RandomStartPointSet(rs,NumStartPoints=100,ArtificialBound=1e4)
rs = 
  RandomStartPointSet with properties:

     NumStartPoints: 100
    ArtificialBound: 10000

您还可以使用圆点表示法来更新属性。

rs.ArtificialBound = 500
rs = 
  RandomStartPointSet with properties:

     NumStartPoints: 100
    ArtificialBound: 500

版本历史记录

在 R2010a 中推出