我想设置的pso参数如下,如何在optimoptions中表示?c1=4.494; %学习因子 c2=4.494; %学习因子 num=500; %种群迭代次数…
- User
我想设置的pso参数如下,如何在optimoptions中表示?c1=4.494; %学习因子 c2=4.494; %学习因子 num=500; %种群迭代次数 sizepop=80; %种群规模 wmax=0.9; %最大惯性权重 wmin=0.5; %最小惯性权重 Vmax=1.0; %最大速度 Vmin=-1.0; %最小速度 popmax=1.0; %最大边界 popmin=-1.0; %最小边界
- Assistant
You can represent these PSO parameters using the following code in optimoptions function:
options = optimoptions('particleswarm','SwarmSize',sizepop,'MaxIterations',num,'InitialSwarmMatrix',InitialSwarmMatrix,'MaxStallIterations',4000,... 'FunctionTolerance',1e-12,'OptimalityTolerance',1e-12,'ObjectiveLimit',-1e20,'VelocityLimit', [Vmin, Vmax],... 'InertiaWeight',@(iter,maxiter)wmax - (wmax-wmin)*(iter/maxiter), 'SocialAdjustmentWeight', c1, 'CognitiveAdjustmentWeight', c2,... 'Display','iter','UseParallel',false,'UseVectorized', true,'Bounds',[popmin;popmax]);
where,
'SwarmSize' - represents the size of the particle swarm.
'MaxIterations' - represents the maximum number of iterations allowed.
- User
我想设置的pso参数如下,如何在optimoptions中表示?c1=4.494; %学习因子 c2=4.494; %学习因子 num=500; %种群迭代次数 sizepop=80; %种群规模 wmax=0.9; %最大惯性权重 wmin=0.5; %最小惯性权重 Vmax=1.0; %最大速度 Vmin=-1.0; %最小速度 popmax=1.0; %最大边界 popmin=-1.0; %最小边界
- Assistant
options = optimoptions('particleswarm', 'SwarmSize', sizepop, 'MaxIterations', num, 'InertiaWeight', wmax, 'SocialAdjustmentWeight', c1, 'CognitiveAdjustmentWeight', c2, ... 'VelocityLimit', [Vmin, Vmax], 'InitialSwarm', [], 'MaxStallIterations', 4000, 'Display', 'off', 'FunctionTolerance', 1e-12, 'ObjectiveLimit', -1e20, 'UseParallel', false, ... 'UseVectorized', true, 'Bounds', [popmin; popmax]);
where,
'SwarmSize' - specifies the number of particles in the swarm.
'MaxIterations' - specifies the maximum number of iterations.
'InertiaWeight' - specifies the maximum inertia weight.
'SocialAdjustmentWeight' - specifies the social learning factor.
'CognitiveAdjustmentWeight' - specifies the cognitive learning factor.
'VelocityLimit' - specifies the range of velocity for each particle.
'InitialSwarm' - specifies the initial swarm. If it is empty, random values are generated.