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

Candidate class contains arrays to be used by optimization algorithm to store data of a solution candidate. More...

#include <candidate.h>

Public Member Functions

 Candidate ()
 
void init_can (int numvar, int fit_size)
 
void init_velocity ()
 
void update_cont (double *input)
 
void update_vel (double *input)
 
void update_best ()
 
void update_global (double *input)
 
void put_to_global ()
 
void read_cont (double *output)
 
void read_vel (double *output)
 
void read_best (double *output)
 
void read_global (double *output)
 
void write_contfit (double *fit, int tt)
 
void write_bestfit (double *fit)
 
void write_globalfit (double *fit)
 
double read_contfit (int i)
 
double read_bestfit (int i)
 
double read_globalfit (int i)
 
int read_bestt ()
 

Friends

class OptAlg
 

Detailed Description

Candidate class contains arrays to be used by optimization algorithm to store data of a solution candidate.

Constructor & Destructor Documentation

◆ Candidate()

Candidate::Candidate ( )
inline

OptAlg class is friend of Candidate class and can access the arrays of solution candidates directly. However, the specific algorithms are not.

Member Function Documentation

◆ init_can()

void Candidate::init_can ( int  numvar,
int  fit_size 
)

A function for allocating memories for storing information for a candidate solution.

Parameters
numvarnumber of variables
fit_sizethe number of objective functions

◆ init_velocity()

void Candidate::init_velocity ( )

A function for allocating memory for additional information: velocity.

◆ put_to_global()

void Candidate::put_to_global ( )

A function for copying can_best array to global_best array.

◆ read_best()

void Candidate::read_best ( double *  output)

A function for reading the can_best array to output array.

◆ read_bestfit()

double Candidate::read_bestfit ( int  i)
inline

A function for reading a fitness value.

Parameters
iindex of fitness value to be read

◆ read_bestt()

int Candidate::read_bestt ( )
inline

A function for reading the number of times the best_fit has been averaged over.

◆ read_cont()

void Candidate::read_cont ( double *  output)

A function for reading the contender array to output array.

◆ read_contfit()

double Candidate::read_contfit ( int  i)
inline

A function for reading a fitness value.

Parameters
iindex of fitness value to be read

◆ read_global()

void Candidate::read_global ( double *  output)

A function for reading the global_best array to output array.

◆ read_globalfit()

double Candidate::read_globalfit ( int  i)
inline

A function for reading a fitness value.

Parameters
iindex of fitness value to be read

◆ read_vel()

void Candidate::read_vel ( double *  output)

A function for reading the velocity array to output array.

◆ update_best()

void Candidate::update_best ( )

A function for putting the contender array to the can_best array.This is done by swapping pointers.

◆ update_cont()

void Candidate::update_cont ( double *  input)

A function for copying onto the contender array from input.

◆ update_global()

void Candidate::update_global ( double *  input)

A function for copying onto the global_best array from input.

◆ update_vel()

void Candidate::update_vel ( double *  input)

A function for copying onto the velocity array from input.

◆ write_bestfit()

void Candidate::write_bestfit ( double *  fit)

A function for copying an array of fitness values to best_fit array.

◆ write_contfit()

void Candidate::write_contfit ( double *  fit,
int  tt 
)

A function for copying an array of fitness values to cont_fit array.

◆ write_globalfit()

void Candidate::write_globalfit ( double *  fit)

A function for copying an array of fitness values to global_fit array.


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