#include <GeneticAlgorithm.h>
Public Member Functions | |
GeneticOptimize () | |
Creates a genetic algorithm. | |
virtual | ~GeneticOptimize () |
Destructor. | |
virtual void | mutate (DREAM::Solution *solution) const |
Single source mutation. | |
virtual void | mutate (DREAM::Solution *father, DREAM::Solution *mother, DREAM::Solution *child) const |
Mutation from two parents. | |
virtual void | thread_level (DREAM::System *system_ptr) |
Thread-level optimization of fixed-priority scheduling using genetic algorithms. | |
virtual void | CPU_level (DREAM::System *system_ptr) |
CPU-level optimization of fixed-priority scheduling using genetic algorithms. | |
Protected Attributes | |
std::vector< DREAM::Solution * > | solution_vector_ |
AVLTree that stores the potential solutions with their fitness as key. | |
DREAM::System * | system_ptr_ |
Pointer to the system. |
Definition at line 140 of file GeneticAlgorithm.h.
DREAM::GeneticOptimize::GeneticOptimize | ( | ) |
virtual DREAM::GeneticOptimize::~GeneticOptimize | ( | ) | [inline, virtual] |
void DREAM::GeneticOptimize::mutate | ( | DREAM::Solution * | solution | ) | const [virtual] |
Single source mutation.
solution | is the solution to be mutated. |
Definition at line 295 of file GeneticAlgorithm.cpp.
References DREAM::Solution::fitness(), DREAM::random(), DREAM::AVLTree< key_type, item_type >::size(), and DREAM::Solution::task_avltree_.
Referenced by CPU_level(), and thread_level().
void DREAM::GeneticOptimize::mutate | ( | DREAM::Solution * | father, | |
DREAM::Solution * | mother, | |||
DREAM::Solution * | child | |||
) | const [virtual] |
Mutation from two parents.
father | is one of the solution sources. | |
mother | is the other solution source. | |
child | is a pointer to the solution to be modified (it can be father or mother as well...). |
Definition at line 313 of file GeneticAlgorithm.cpp.
References DREAM::Solution::fitness(), DREAM::random(), DREAM::AVLTree< key_type, item_type >::size(), and DREAM::Solution::task_avltree_.
void DREAM::GeneticOptimize::thread_level | ( | DREAM::System * | system_ptr | ) | [virtual] |
Thread-level optimization of fixed-priority scheduling using genetic algorithms.
We partition the solution space into 8 zones. One zone is reserved for the best solutions. Three zones are reserved for mutations from parents. Two zones are reserved for single mutations. Two zones are reserved for random generation only.
system_ptr | is a pointer to the System. |
Definition at line 359 of file GeneticAlgorithm.cpp.
References DREAM::for_each(), mutate(), Option::number_of_repetitions_, Option::optimization_space_, DREAM::random(), DREAM::System::reset(), solution_vector_, system_ptr_, and DREAM::System::visitor_update_task_avltree().
Referenced by main().
void DREAM::GeneticOptimize::CPU_level | ( | DREAM::System * | system_ptr | ) | [virtual] |
CPU-level optimization of fixed-priority scheduling using genetic algorithms.
Optimizes both priorities and subpriorities. We partition the solution space into 8 zones. One zone is reserved for the best solutions. Three zones are reserved for mutations from parents. Two zones are reserved for single mutations. Two zones are reserved for random generation only.
system_ptr | is a pointer to the System. |
Definition at line 461 of file GeneticAlgorithm.cpp.
References DREAM::for_each(), mutate(), Option::number_of_repetitions_, Option::optimization_space_, DREAM::random(), DREAM::System::reset(), solution_vector_, system_ptr_, and DREAM::System::visitor_update_task_avltree().
Referenced by main().
std::vector<DREAM::Solution*> DREAM::GeneticOptimize::solution_vector_ [protected] |
AVLTree that stores the potential solutions with their fitness as key.
Definition at line 181 of file GeneticAlgorithm.h.
Referenced by CPU_level(), and thread_level().
DREAM::System* DREAM::GeneticOptimize::system_ptr_ [protected] |
Pointer to the system.
Definition at line 184 of file GeneticAlgorithm.h.
Referenced by CPU_level(), and thread_level().