ElfPSP_AntColony
Protein Structure Prediction using Ant Colony Optimization
|
Encapsulates a solution that is built by an ant. More...
#include <acosolution.h>
Public Member Functions | |
ACOSolution () | |
Default constructor; starts as an empty solution. More... | |
ACOSolution (std::vector< char > &directions) | |
Constructs a solution from a vector of directions. More... | |
vec3< int > | bead (unsigned int i) |
Gets an specific bead. More... | |
char | direction (unsigned int i) |
Gets an specific direction. More... | |
vec3< int > | previous_direction () const |
Returns the relative direction between the last 2 beads. More... | |
int | count_contacts (const HPChain &chain) const |
Returns the number of H-H contacts within the solution. More... | |
void | perturb_one (std::mt19937 &dRandGen) |
The solution has a vector of N directions, this procedure chooses a random direction and randomizes it. More... | |
bool | has_error () |
Returns current error state. More... | |
void | set_error () |
Sets error to signalize existence of an error. More... | |
void | clear_error () |
Clears the internal error state. More... | |
std::vector< vec3< int > > & | vector () |
Vector of bead coordinates. More... | |
const std::vector< vec3< int > > & | vector () const |
Vector of bead coordinates. More... | |
std::vector< char > & | directions () |
Vector of directions taken by the ant. More... | |
const std::vector< char > & | directions () const |
Vector of directions taken by the ant. More... | |
Static Public Member Functions | |
static const char | DIR_TO_CHAR (char d) |
Maps directions to characters U, D, L, R, F. More... | |
static vec3< int > | DIRECTION_VECTOR (vec3< int > prevDirection, char dir) |
Given a previous direction and a relative direction, returns the corresponding delta vector. More... | |
Static Public Attributes | |
static const char | UP = 0 |
Static constants representing relative directions. More... | |
static const char | DOWN = 1 |
Relative direction. More... | |
static const char | LEFT = 2 |
Relative direction. More... | |
static const char | RIGHT = 3 |
Relative direction. More... | |
static const char | FRONT = 4 |
Relative direction. More... | |
Private Attributes | |
std::vector< vec3< int > > | dVector |
Vector of bead coordinates. More... | |
std::vector< char > | dDirections |
Vector of directions taken by the ant. More... | |
bool | dError |
May be used to indicate errors. More... | |
Encapsulates a solution that is built by an ant.
A solution is thus a vector of coordinates of the beads of a protein.
|
inline |
Default constructor; starts as an empty solution.
|
inline |
Constructs a solution from a vector of directions.
|
inline |
Gets an specific bead.
|
inline |
Clears the internal error state.
|
inline |
Returns the number of H-H contacts within the solution.
chain | The HPChain of the protein that this ACOSolution represents. |
|
inlinestatic |
Maps directions to characters U, D, L, R, F.
DIR_TO_CHAR(0)
yields 'U'.
|
inline |
Gets an specific direction.
Given a previous direction and a relative direction, returns the corresponding delta vector.
Say we have a sequence of beads b1 and b2, each with their own coordinates, and that we want to add a new bead b3 whose relative direction is D from b2 and b1. In this case, the previous direction is (b2 - b1). This function thus returns the delta vector that should be added to bead b2 in order to obtain b3. That is, b3 = (b2 + delta), where delta is the result of this function.
prevDirection | direction built from the previous 2 beads as (b2 - b1). |
dir | relative direction to follow, starting from the given previous direction. |
|
inline |
Vector of directions taken by the ant.
|
inline |
Vector of directions taken by the ant.
|
inline |
Returns current error state.
|
inline |
The solution has a vector of N directions, this procedure chooses a random direction and randomizes it.
After randomizing it, the internal bead coordinates are also recalculated.
|
inline |
Returns the relative direction between the last 2 beads.
|
inline |
Sets error to signalize existence of an error.
|
inline |
Vector of bead coordinates.
|
inline |
Vector of bead coordinates.
|
private |
Vector of directions taken by the ant.
|
private |
May be used to indicate errors.
|
static |
Relative direction.
|
private |
Vector of bead coordinates.
|
static |
Relative direction.
|
static |
Relative direction.
|
static |
Relative direction.
|
static |
Static constants representing relative directions.
Relative direction.