ElfPSP_AntColony
Protein Structure Prediction using Ant Colony Optimization
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ACOPredictor Class Reference

Encapsulates the whole process of performing Ant Colony Optimization to find a protein conformation with low free energy. More...

#include <acopredictor.h>

Classes

struct  Results
 Structures used to return results to the callee. More...
 

Public Member Functions

 ACOPredictor (const Config &config)
 Constructor from configuration file. More...
 
 ~ACOPredictor ()
 The destructor frees memory allocated for holding internal data structures. More...
 
struct Results predict ()
 Runs the ACO optimization to predict the protein structure. More...
 

Private Member Functions

double & pheromone (int i, int d) const
 Returns the pheromone at step i and direction d. More...
 
double random (int tid=0)
 Returns a random number in [0,1). More...
 
std::vector< double > get_heuristics (const std::vector< vec3< int >> &possiblePos, const std::vector< vec3< int >> &beadVector)
 Returns a vector V with 5 heuristics. More...
 
std::vector< double > get_probabilities (int movIndex, std::vector< double > heuristics) const
 Return a vector V with 5 probabilities. More...
 
ACOSolution ant_develop_solution (int tid=0)
 Makes an ant develop a solution, beginning from the start. More...
 
void ant_deposit_pheromone (const std::vector< char > &directions, int nContacts)
 Deposits pheromones along the trail followed by the given ant. More...
 
void perform_cycle (std::vector< ACOSolution > &antsSolutions, int *nContacts)
 Performs a cycle of the ant colony. More...
 

Private Attributes

int dNMovElems
 Stores the number of moviments performed by an ant; its value is N-2 where N is the number of beads in the protein. More...
 
int dHCount
 Stores the number of hydrophobic (H) beads in the protein.
 
double * dPheromone
 Pheromone matrix. More...
 
std::vector< std::mt19937 > dRandGen
 Random number generators used throughout the ACO algorithm. More...
 
std::uniform_real_distribution dRandDist
 Random distribution that uses dRandGen to generate random numbers. More...
 
ACOSolution dBestSol
 Holds the best solution found by this colony. More...
 
int dBestContacts
 Holds the num of contacts in the best solution. More...
 
HPChain dHPChain
 See the user configuration file for documentation. More...
 
int dCycles
 See the user configuration file for documentation. More...
 
int dNAnts
 See the user configuration file for documentation. More...
 
double dAlpha
 See the user configuration file for documentation. More...
 
double dBeta
 See the user configuration file for documentation. More...
 
double dEvap
 See the user configuration file for documentation. More...
 
int dLSFreq
 See the user configuration file for documentation. More...
 
int dExchangedAnts
 See the user configuration file for documentation. More...
 
int dRandSeed
 See the user configuration file for documentation. More...
 

Detailed Description

Encapsulates the whole process of performing Ant Colony Optimization to find a protein conformation with low free energy.

Constructor & Destructor Documentation

◆ ACOPredictor()

ACOPredictor::ACOPredictor ( const Config config)

Constructor from configuration file.

Parameters
configThe configuration file object from which we can read user configured-parameters.

◆ ~ACOPredictor()

ACOPredictor::~ACOPredictor ( )

The destructor frees memory allocated for holding internal data structures.

Member Function Documentation

◆ ant_deposit_pheromone()

void ACOPredictor::ant_deposit_pheromone ( const std::vector< char > &  directions,
int  nContacts 
)
inlineprivate

Deposits pheromones along the trail followed by the given ant.

Parameters
directionsVector of directions followed by the ant.
nContactsNumber of H-H contacts in the protein built by the given ant.

◆ ant_develop_solution()

ACOSolution ACOPredictor::ant_develop_solution ( int  tid = 0)
private

Makes an ant develop a solution, beginning from the start.

Returns the developed solution.

◆ get_heuristics()

vector< double > ACOPredictor::get_heuristics ( const std::vector< vec3< int >> &  possiblePos,
const std::vector< vec3< int >> &  beadVector 
)
private

Returns a vector V with 5 heuristics.

V[d] is the heuristic associated with direction d.

◆ get_probabilities()

vector< double > ACOPredictor::get_probabilities ( int  movIndex,
std::vector< double >  heuristics 
) const
private

Return a vector V with 5 probabilities.

V[d] is the probability of going to direction d.

◆ perform_cycle()

void ACOPredictor::perform_cycle ( std::vector< ACOSolution > &  antsSolutions,
int *  nContacts 
)
private

Performs a cycle of the ant colony.

A cycle consitst of each:

  1. ant developing a solution,
  2. calculating the solution contacts,
  3. performing local search in each solution,
  4. finding the best solution generated,
  5. evaporating pheromones and finally
  6. depositing pheromones.

This function is the one parallelized for multiple parallel programming models, in the files acopredictor_ant_cycle[...].

◆ pheromone()

double & ACOPredictor::pheromone ( int  i,
int  d 
) const
inlineprivate

Returns the pheromone at step i and direction d.

◆ predict()

struct ACOPredictor::Results ACOPredictor::predict ( )

Runs the ACO optimization to predict the protein structure.

Returns
the best solution found by the optimization algorithm.

◆ random()

double ACOPredictor::random ( int  tid = 0)
inlineprivate

Returns a random number in [0,1).

Member Data Documentation

◆ dAlpha

double ACOPredictor::dAlpha
private

See the user configuration file for documentation.

◆ dBestContacts

int ACOPredictor::dBestContacts
private

Holds the num of contacts in the best solution.

◆ dBestSol

ACOSolution ACOPredictor::dBestSol
private

Holds the best solution found by this colony.

◆ dBeta

double ACOPredictor::dBeta
private

See the user configuration file for documentation.

◆ dCycles

int ACOPredictor::dCycles
private

See the user configuration file for documentation.

◆ dEvap

double ACOPredictor::dEvap
private

See the user configuration file for documentation.

◆ dExchangedAnts

int ACOPredictor::dExchangedAnts
private

See the user configuration file for documentation.

◆ dHPChain

HPChain ACOPredictor::dHPChain
private

See the user configuration file for documentation.

◆ dLSFreq

int ACOPredictor::dLSFreq
private

See the user configuration file for documentation.

◆ dNAnts

int ACOPredictor::dNAnts
private

See the user configuration file for documentation.

◆ dNMovElems

int ACOPredictor::dNMovElems
private

Stores the number of moviments performed by an ant; its value is N-2 where N is the number of beads in the protein.

◆ dPheromone

double* ACOPredictor::dPheromone
private

Pheromone matrix.

◆ dRandDist

std::uniform_real_distribution ACOPredictor::dRandDist
private

Random distribution that uses dRandGen to generate random numbers.

◆ dRandGen

std::vector<std::mt19937> ACOPredictor::dRandGen
private

Random number generators used throughout the ACO algorithm.

◆ dRandSeed

int ACOPredictor::dRandSeed
private

See the user configuration file for documentation.


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