MCScheduling 1.0
Set of Algorithms for Solving Mixed-Criticality Scheduling
Public Member Functions | Protected Member Functions
MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm Class Reference

A base class for implementation of a genetic algorithm. More...

Inheritance diagram for MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm:
MCScheduling.MixedCriticality.GA.CMixedCriticalityGeneticAlgorithm

List of all members.

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.

Detailed Description

A base class for implementation of a genetic algorithm.


Constructor & Destructor Documentation

MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.CBaseGeneticAlgorithm ( CConfiguration  configuration) [protected]

Creates and initializes the genetic algorithm.

Parameters:
configurationThe configuration for this genetic algorithm.

Member Function Documentation

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.

Parameters:
populationThe 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.

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.

Parameters:
countThe number of evolutions to be performed.
Returns:
the best chromosome of the evolved population.
CConfiguration MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.getConfiguration ( )

Returns the configuration of this genetic algorithm.

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.

Returns:
The fittest chromosome of the current population.
int MCScheduling.GeneticAlgorithm.CBaseGeneticAlgorithm.getGenerationNumber ( )

Returns the generation number of the current population.

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.

Exceptions:
InvalidOperationExceptionif 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.

Parameters:
configurationThe settings of this genetic algorithm.
Exceptions:
NullReferenceExceptionIf configuration is null.
 All Classes Namespaces Functions Variables Properties