I need efficiently initialize a population of soldiers (particles) with random positions within feasible bounds in MATLAB?
12 次查看(过去 30 天)
显示 更早的评论
I'm working on WSO for optimal placement of capacitor. How can you efficiently initialize a population of soldiers (particles) with random positions within feasible bounds in MATLAB?
0 个评论
采纳的回答
recent works
2023-12-31
Use the rand function to generate random numbers within the specified limits for each decision variable.
Example, to create a 50x2 matrix of random capacitor locations between buses 2 and 33
soldier_positions = 2 + (32-2).*rand(50,2);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle Swarm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!