ElfPSP_ParallelABC
Protein Structure Prediction using Parallel Artificial Bee Colony Optimization
|
Routines for manipulating the bee hive global object. More...
#include <solution/solution.h>
Go to the source code of this file.
Functions | |
void | HIVE_initialize () |
Initializes the global HIVE object. More... | |
void | HIVE_destroy () |
Frees memory allocated in HIVE. More... | |
int | HIVE_nSols () |
Returns the number of solutions in the hive. More... | |
int | HIVE_cycle () |
Returns the number of cycles elapsed within the hive. More... | |
Solution * | HIVE_solutions () |
Returns the vector of solutions within the hive. More... | |
Solution | HIVE_solution (int idx) |
Returns a specific solution. More... | |
Solution | HIVE_best_sol () |
Returns a pointer to the best solution found so far in the hive. More... | |
int | HIVE_hp_size () |
Returns the size of the protein being predicted. More... | |
void | HIVE_nullify_best () |
Nullifies the best solution, without freeing it. More... | |
void | HIVE_increment_cycle () |
Tells the HIVE to increment one cycle in the cycle counter. | |
void | HIVE_add_solution (Solution sol, int index, int hpSize) |
Adds solution 'sol' as the index-th solution of the HIVE. More... | |
void | HIVE_increment_idle (int index) |
Increments the idle_iterations of the solution desired. More... | |
Solution | HIVE_perturb_solution (int index, int hpSize) |
Causes a minor variation in the solution at given index. More... | |
void | HIVE_try_replace_solution (Solution alt, int index, int hpSize) |
The current Solution with index 'index' is SOL1. More... | |
void | HIVE_force_replace_solution (Solution alt, int index) |
Replaces solution at index 'index', unconditionally. More... | |
void | HIVE_replace_best (Solution newBest) |
Replaces the best solution with the given solution. More... | |
Routines for manipulating the bee hive global object.
void HIVE_add_solution | ( | Solution | sol, |
int | index, | ||
int | hpSize | ||
) |
Adds solution 'sol' as the index-th solution of the HIVE.
No deep copy is made.
Also checks the fitness of 'sol' and replaces the best solution in the HIVE if needed This procedure does not free the current solution in that spot.
Solution HIVE_best_sol | ( | ) |
Returns a pointer to the best solution found so far in the hive.
int HIVE_cycle | ( | ) |
Returns the number of cycles elapsed within the hive.
void HIVE_destroy | ( | ) |
Frees memory allocated in HIVE.
Does not free the best solution
void HIVE_force_replace_solution | ( | Solution | alt, |
int | index | ||
) |
Replaces solution at index 'index', unconditionally.
Does not check if 'alt' is the new best solution of the hive.
int HIVE_hp_size | ( | ) |
Returns the size of the protein being predicted.
void HIVE_increment_idle | ( | int | index | ) |
Increments the idle_iterations of the solution desired.
void HIVE_initialize | ( | ) |
Initializes the global HIVE object.
int HIVE_nSols | ( | ) |
Returns the number of solutions in the hive.
void HIVE_nullify_best | ( | ) |
Nullifies the best solution, without freeing it.
Solution HIVE_perturb_solution | ( | int | index, |
int | hpSize | ||
) |
Causes a minor variation in the solution at given index.
The Solution with index 'index' is SOL1, we take a random SOL2 and a random spot SPOT in the Solutions' movement chain. SOL1's movement at spot SPOT is made to approach the value in SOL2's movement at the same spot.
void HIVE_replace_best | ( | Solution | newBest | ) |
Replaces the best solution with the given solution.
A deep copy is not made, so modifying 'newBest' after calling this function is unsafe.
Solution HIVE_solution | ( | int | idx | ) |
Returns a specific solution.
Solution* HIVE_solutions | ( | ) |
Returns the vector of solutions within the hive.
void HIVE_try_replace_solution | ( | Solution | alt, |
int | index, | ||
int | hpSize | ||
) |
The current Solution with index 'index' is SOL1.
Checks if 'alt' has a better fitness, and if that is so, replaces SOL1 with 'alt'. If 'alt' is worse, this function frees it, so manipulating 'alt' later is unsafe, and the idle interations of SOL1 is increased. Checks if 'alt' is the new best solution of the hive.