You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: GPSO.m
    path of file: ./repos/PlatEMO/PlatEMO/Algorithms/Single-objective optimization/GPSO
    
    the code of the file until where you have to start completion: classdef GPSO < ALGORITHM
% <single> <real> <large/none> <constrained/none>
% Gradient based particle swarm optimization algorithm

%------------------------------- Reference --------------------------------
% M. M. Noel, A new gradient based particle swarm optimization algorithm
% for a
    
function main(Algorithm,Problem)
            %% Generate random population 
            Population = Problem.Initialization();
            Pbest      = Population;
            [~,best]   = min(FitnessSingle(Pbest));
            Gbest      = LocalSearch(Problem,Pbest(best));
            
            %% Optimization
            while Algorithm.NotTerminated(Population)
                Population     = OperatorPSO(Problem,Population,Pbest,Gbest);
                replace        = FitnessSingle(Pbest) > FitnessSingle(Population);
                Pbest(replace) = Population(replace);
                [~,best]       = min(FitnessSingle(Pbest));
                Gbest          = LocalSearch(Problem,Pbest(best));
            end