Code covered by the BSD License  

Highlights from
Another Particle Swarm Toolbox

image thumbnail

Another Particle Swarm Toolbox

by

 

01 Dec 2009 (Updated )

Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.

psoplotscorediversity(options,state,flag)
function [state,options] = psoplotscorediversity(options,state,flag)
% Plots a histogram containing the best and mean scores of particle swarm.

if strcmp(flag,'init')
    set(gca,'NextPlot','replacechildren',...
        'XLabel',xlabel('Scores'),...
        'YLabel',ylabel('Number of inidividuals'))
end

[n,bins] = hist(state.Score) ;
bar(bins,n,'Tag','scorehistogram','FaceColor',[0.1 0.1 0.5])

Contact us