Skip to content

KevinJM17/Particle-Swarm-Optimization-PSO-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Particle Swarm Optimization

Particle Swarm Optimization (PSO) is an artificial intelligence technique that can be used to find appropriate solution to complex maximization and minimization problems.

In this repository I have performed PSO on the equation: y = -15 (Sin(2x)^2 - (x-2)^2 + 160), to get the optimal position of x to obtain the maximum of the function.

PSO Process

Step 1: Initialize the population.

Step 2: Evaluate the fitness of each particle.

Step 3: Modify the velocity & position of all particles based on previous best (pbest) and global best (gbest).

Step 4: Terminate on some condition

Step 5: Go to step 2.

Velocity Updation (Max velocity, Vmax = 20)

Vi(t + 1) = W.Vi(t) + C1.r1.(pbesti - xi(t)) + C2.r2.(gbest - xi(t))

W -> weight factor

C1, C2 -> acceleration constant

pbesti -> personal best position attained by each particle i so far

gbest -> global best position discovered so far by any particle

r1, r2 -> random number uniformly distributed between [0, 1]

Position Updation

xi(t + 1) = xi(t) + vi(t + 1)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors