Resolution of the gamultiobj's variable
1 回表示 (過去 30 日間)
古いコメントを表示
Hi community!
To what resolution does the random search algorithm generates new samples? Is it possible to specify a certain resolution to search for a varible?
For example, the independent variable I want to search over, a, has the limit of
. Is it possible to only search for a that is as accurate as the level of 0.01? It reduces the search space to only 200 points.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1702651/image.png)
I assume doing this would make the search converge faster and also, in my application, I do not really care about a at the decimal of 0.001.
Thank you in advance for your help!
Xiaowei
0 件のコメント
回答 (2 件)
Nipun
2024 年 6 月 11 日
編集済み: Walter Roberson
2024 年 7 月 19 日
Hi Xiaowei,
I understand that you want to specify a resolution for the random search algorithm. You can discretize the search space manually:
a_values = -1:0.01:1; % Set resolution to 0.01
This approach limits the search space, making the search process faster.
For more details on generating a random scalar, refer to MATLAB documentation: https://www.mathworks.com/help/comm/ref/randsrc.html
Hope this helps.
Regards,
Nipun
Walter Roberson
2024 年 7 月 19 日
Search over integers -100 to +100 and divide by 100 before use.
2 件のコメント
Walter Roberson
2024 年 7 月 22 日
nvars = 1; %number of variables
intcon = 1; %first variable has integer constraints
A = []; b = [];
Aeq = []; beq = [];
lb = -100; ub = 100;
nonlcon = [];
options = [];
results = gamultiobj(@(vars) ObjectiveFunction(vars/100), nvars, A, b, Aeq, beq, lb, ub, nonlcon, intcon, options);
参考
カテゴリ
Help Center および File Exchange で Direct Search についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!