Don't define a variable in your code with the same name as a function or class you want to use in that code.
Change the variable name particle in your PSO code to particles (which I would avoid as too easy for a human to mistype or misread as particle) or something like listOfParticles and make that an array of particle objects.
Best Answer