Evolutionary Algorithm for Adaptive Phase Estimation  1.0.2
Public Member Functions | List of all members
PSO Class Reference

PSO class contains the functions that are specific to this particular optimization algorithm. More...

#include <mpi_optalg.h>

Inheritance diagram for PSO:
OptAlg

Public Member Functions

 PSO (Problem *problem_ptr, Rng *gaussian_rng, int pop_size)
 
void put_to_best ()
 
void combination ()
 
void selection ()
 
void write_param (double *param_array)
 
void read_param (double *param_array)
 
void fit_to_global ()
 
void find_global ()
 
- Public Member Functions inherited from OptAlg
 OptAlg (Problem *problem_ptr, Rng *gaussian_rng, int pop_size)
 
void Init_population (int psize)
 
void Init_previous (double prev_dev, double new_dev, int psize, double *prev_soln)
 
void Cont_fitness (int p)
 
void Best_fitness (int p)
 
void update_popfit ()
 
void set_success (int iter, bool goal)
 
bool check_success (int t, double *current_fitarray, double *memory_fitarray, int data_size, double t_goal, bool *mem_ptype, int *numvar, int N_cut, double *memory_forT)
 
double Final_select (double *fit, double *solution, double *fitarray)
 
double avg_Final_select (double *solution, int repeat, double *soln_fit, double *fitarray)
 
void dev_gen (double *dev_array, double prev_dev, double new_dev, int cut_off)
 
int find_max (double *fit)
 

Additional Inherited Members

- Public Attributes inherited from OptAlg
Problemprob
 
bool success
 
bool policy_type
 
- Protected Attributes inherited from OptAlg
int num
 
int num_fit
 
Rng * gaussian_rng
 
int pop_size
 
int T
 
int t
 
Candidatepop
 
bool goal
 
int total_pop
 
int my_rank
 
int nb_proc
 

Detailed Description

PSO class contains the functions that are specific to this particular optimization algorithm.

Member Function Documentation

◆ combination()

void PSO::combination ( )
virtual

This function main purpose is to prepare the population for optimization after the population is initialized and the first calculation of the fitness function.

Combination() generates the position and velocity for the next time step using the rule with inertia term. The new position is stored in the contender and computed for mean fitness value.

Reimplemented from OptAlg.

◆ find_global()

void PSO::find_global ( )
virtual

This function copies memories on best array to global array.

The global best position is find for a neighborhood of three. Because of the circular topology, the neighbors are on other processors and the fitness values from the best array are sent back to the candidate. The candidate then communicates with the processor containing the highest fitness values of the three and ask for the rest of the information.

Reimplemented from OptAlg.

◆ fit_to_global()

void PSO::fit_to_global ( )
inlinevirtual

This function reads the search parameters that are currently in use.

Reimplemented from OptAlg.

◆ put_to_best()

void PSO::put_to_best ( )
virtual

This function in PSO record the first position as personal best, initialize the velocity and find global best position in preparation for the iterative steps.

Reimplemented from OptAlg.

◆ read_param()

void PSO::read_param ( double *  param_array)
virtual

This function let the user specify new values to the search parameters.

Reimplemented from OptAlg.

◆ selection()

void PSO::selection ( )
virtual

This function generates new candidates that competes with the existing population. This is one potential bottleneck in the communication between processors.

In PSO, selection chooses whether the position stored in contender is a new personal best, and, if so, store it in best array. The global best position is then searched and updated.

Reimplemented from OptAlg.

◆ write_param()

void PSO::write_param ( double *  param_array)
virtual

This function performs selects the candidates for the next round of iteration.

Reimplemented from OptAlg.


The documentation for this class was generated from the following files: