MCScheduling 1.0
Set of Algorithms for Solving Mixed-Criticality Scheduling
|
A base class for implementation of a genetic algorithm. More...
Public Member Functions | |
void | setConfiguration (CConfiguration configuration) |
Sets up the configuration of this genetic algorithm. | |
CConfiguration | getConfiguration () |
Returns the configuration of this genetic algorithm. | |
abstract void | createInitialPopulation (CPopulation population) |
Creates a new initial population for the start of the genetic algorithm. | |
void | reset () |
Resets the genetic algorithm to initial state, which means a new initial population is generated and the generation counter is set to 0. | |
IChromosome | evolve () |
Performs single step of evolution, and returns the best chromosome of the evolved population. | |
IChromosome | evolve (int count) |
Performs count number of evoluations, and then returns the best chromosome of the last evolved population. | |
IChromosome | getFittestChromosome () |
Returns the fittest chromosome of the current population, i.e. | |
int | getGenerationNumber () |
Returns the generation number of the current population. | |
Protected Member Functions | |
CBaseGeneticAlgorithm (CConfiguration configuration) | |
Creates and initializes the genetic algorithm. |
A base class for implementation of a genetic algorithm.
MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.CBaseGeneticAlgorithm | ( | CConfiguration | configuration | ) | [protected] |
Creates and initializes the genetic algorithm.
configuration | The configuration for this genetic algorithm. |
abstract void MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.createInitialPopulation | ( | CPopulation | population | ) | [pure virtual] |
Creates a new initial population for the start of the genetic algorithm.
The size of the population must agree with the value set in the configuration, see this.reset() for explanation.
population | The initial population to be filled up with chromosomes. |
Implemented in MCScheduling.MixedCriticality.GA.CMixedCriticalityGeneticAlgorithm.
IChromosome MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.evolve | ( | ) |
Performs single step of evolution, and returns the best chromosome of the evolved population.
IChromosome MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.evolve | ( | int | count | ) |
Performs count number of evoluations, and then returns the best chromosome of the last evolved population.
count | The number of evolutions to be performed. |
CConfiguration MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.getConfiguration | ( | ) |
Returns the configuration of this genetic algorithm.
IChromosome MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.getFittestChromosome | ( | ) |
Returns the fittest chromosome of the current population, i.e.
the best current solution to the problem the algorithm is supposed to solve.
int MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.getGenerationNumber | ( | ) |
Returns the generation number of the current population.
void MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.reset | ( | ) |
Resets the genetic algorithm to initial state, which means a new initial population is generated and the generation counter is set to 0.
Note: This method must be called prior to calling the this.evaluate method.
InvalidOperationException | if the size of the initial population created by calling createInitialPopulation does not agree with the size set in the configuration. |
void MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.setConfiguration | ( | CConfiguration | configuration | ) |
Sets up the configuration of this genetic algorithm.
configuration | The settings of this genetic algorithm. |
NullReferenceException | If configuration is null. |