Skip to content

ConnorChristie/pso-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Particle Swarm Optimisation

This is an implementation of the PSO algorithm written in C.

Running

Call the following method with your search bounds and swarm params:

coordinate_t run_pso(context_t *context, swarm_params_t swarm_params);

Example Code

space_t search_space = {
    .lower = { 0, 0, 0 },
    .upper = { 10000, 10000, M_PI * 2 }
};

context_t context = {
    .search_space = search_space,
    .actual_coord = { 2500, 400, M_PI }
};

swarm_params_t swarm_params = {
    .swarm_size = 100,
    .iterations = 200,
    .omega = 0.5,
    .phi_p = 0.5,
    .phi_g = 0.5
};

coordinate_t best_position = run_pso(&context, swarm_params);

About

Particle Swarm Optimisation in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages