Particle swarm optimization: Difference between revisions
Content added Content deleted
(updated task description) |
(→{{header|J}}: simplify defn of michalewicz) |
||
Line 81: | Line 81: | ||
GlobalBestValue: _1.91322</lang> |
GlobalBestValue: _1.91322</lang> |
||
Apply to Michalewicz Function: |
Apply to Michalewicz Function: |
||
⚫ | |||
<lang J> |
|||
michalewicz =: [: -@(+/) sin * 20 ^~ sin@(pi %~ >:@i.@# * *:) NB. tacit equivalent |
|||
⚫ | |||
state =: pso_init 0 0 ; (pi,pi) ; 0.3 0.3 0.3; 1000 |
state =: pso_init 0 0 ; (pi,pi) ; 0.3 0.3 0.3; 1000 |
||
Line 90: | Line 89: | ||
omega, phip, phig: 0.3 0.3 0.3 |
omega, phip, phig: 0.3 0.3 0.3 |
||
nParticles: 1000 |
nParticles: 1000 |
||
state =: (michalewicz pso)^:30 state |
state =: (michalewicz pso)^:30 state |