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

The configuration represents a setting of a genetic algorithm, i.e. More...

Inheritance diagram for MCScheduling.GeneticAlgorithm.CConfiguration:
MCScheduling.MixedCriticality.GA.CMixedCriticalityConfiguration

List of all members.

Classes

class  CGreaterFitterComparer
 The default fitness comparer. More...

Public Member Functions

 CConfiguration (String configurationName)
 Creates a default configuration with the specified name.
 CConfiguration (String configurationFilePath, int ignore)
 Reads in the configuration from the specified file.
void setName (String configurationName)
 Sets the name for this configuration.
String getName ()
 Returns the name of the configuration.
void setFitnessEvaluator (IFitnessEvaluator fitnessEvaluator)
 Sets the fitness evaluator that will be used by this genetic algorithm.
IFitnessEvaluator getFitnessEvaluator ()
 Returns the fitness comparer used in this configuration.
void setFitnessComparer (IFitnessComparer fitnessComparer)
 Sets the fitness comparer for this configuration.
IFitnessComparer getFitnessComparer ()
 Returns the fitness comparer that is used in this configuration.
void setFitnessScaler (IFitnessScaler fitnessScaler)
 Sets the fitness scaler for this configuration.
IFitnessScaler getFitnessScaler ()
 Returns the fitness scaler that is used in this configuration.
void setGeneDistanceMeasurer (IGeneDistanceMeasurer geneDistanceMeasurer)
 Sets the gene distance measurer for this configuration.
IGeneDistanceMeasurer getGeneDistanceMeasurer ()
 Returns the gene distance measurer that is used in this configuration.
void setBreeder (CBaseBreeder breeder)
 Sets the breeder to be used in this configuration.
CBaseBreeder getBreeder ()
 Returns the breeder that is used by this configuration.
void setNaturalSelector (ISelectionOperator naturalSelector)
 Sets the natural selector to be used for this genetic algorithm.
ISelectionOperator getNaturalSelector ()
 Returns the natural selector that is used in this configuration.
void setRandomGenerator (IRandomizer randomGenerator)
 Sets the pseudo-random number generator that will be used by this algorithm.
IRandomizer getRandomGenerator ()
 Returns the pseudo-random number generator that is used by this configuration.
double getTolerance ()
 Returns the maximum allowed difference of two decimals in which are considered as being the same.
void setTolerance (double tolerance)
 Sets the maximum allowed difference of two decimals in which are considered as being the same.
void setNumberOfFittestToCopy (int numberOfFittestToCopy)
 Sets the number of fittest chromosomes that will be always copied into the mating pool.
int getNumberOfFittestToCopy ()
 Returns the number of fittest chromosomes that is being always copied into the mating pool.
void addCrossoverOperator (ICrossoverOperator crossoverOperator)
 Adds a crossover operator that is used by this genetic algorithm.
void removeCrossoverOperator (ICrossoverOperator crossoverOperator)
 Removes the specified crossover operator from the list of genetic operators used by this genetic algorithm.
void removeAllCrossoverOperators ()
 Removes all the crossover operators registred with this configuration.
List< ICrossoverOperatorgetCrossoverOperators ()
 Returns the crossover operators setup in this configuration.
void addMutationOperator (IMutationOperator mutationOperator)
 Adds a mutation operator that is used by this genetic algorithm.
void removeMutationOperator (IMutationOperator mutationOperator)
 Removes the specified mutation operator from the list of genetic operators used by this genetic algorithm.
void removeAllMutationOperators ()
 Removes all the mutation operators registred with this configuration.
List< IMutationOperatorgetMutationOperators ()
 Returns the mutation operators setup in this configuration.
void notifyConfigurationDependentComponents ()
 Notifies the dependent components registered with this configuration before the genetic algorithm that uses them is executed.
void setPopulationSize (int populationSize)
 Sets up the population size that will be used by this genetic algorithm.
int getPopulationSize ()
 Returns the population size.
void setChromosomeSize (int chromosomeSize)
 Sets the size of a chromosome that will be used by this genetic algorithm.
int getChromosomeSize ()
 Returns the size of a chromosome that will be used by this genetic algorithm.
void setChromosomePool (IChromosomePool chromosomePool)
 Sets the chromosome pool that will be used by this configuration.
IChromosomePool getChromosomePool ()
 Returns the chromosome pool used by this configuration.
void serialize (string filePath)
 Serializes this configuration into the specified file.
void deserialize (string filePath)
 Deserializes the configuration in the specified file and sets the fields of this configuration according to it.

Detailed Description

The configuration represents a setting of a genetic algorithm, i.e.

what genetic operators it uses (selectors, crossover, mutation), what is the population size, chromosome size, and mainly what fitness function evaluates chromosomes.


Constructor & Destructor Documentation

MCScheduling.GeneticAlgorithm.CConfiguration.CConfiguration ( String  configurationName)

Creates a default configuration with the specified name.

Parameters:
configurationNameThe user-specific name for the configuration.
MCScheduling.GeneticAlgorithm.CConfiguration.CConfiguration ( String  configurationFilePath,
int  ignore 
)

Reads in the configuration from the specified file.

Parameters:
configurationFilePathThe file from which the configuration will be created.
ignoreAn ignored parameter.

Member Function Documentation

void MCScheduling.GeneticAlgorithm.CConfiguration.addCrossoverOperator ( ICrossoverOperator  crossoverOperator)

Adds a crossover operator that is used by this genetic algorithm.

These operators are used in the reproduction phase of the evolution process; in the order in which they were added by this method.

Parameters:
crossoverOperatorThe crossover operator to be added.
Exceptions:
ArgumentNullExceptionIf the crossoverOperator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.addMutationOperator ( IMutationOperator  mutationOperator)

Adds a mutation operator that is used by this genetic algorithm.

These operators are used in the reproduction phase of the evolution process; in the order in which they were added by this method.

Parameters:
mutationOperatorThe crossover operator to be added.
Exceptions:
ArgumentNullExceptionIf the mutationOperator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.deserialize ( string  filePath)

Deserializes the configuration in the specified file and sets the fields of this configuration according to it.

Parameters:
filePathThe path where the configuration is going to be deserialized from.
CBaseBreeder MCScheduling.GeneticAlgorithm.CConfiguration.getBreeder ( )

Returns the breeder that is used by this configuration.

Returns:
The breeder that is used by this configuration.
IChromosomePool MCScheduling.GeneticAlgorithm.CConfiguration.getChromosomePool ( )

Returns the chromosome pool used by this configuration.

Returns:
The chromosome pool used by this configuration.
int MCScheduling.GeneticAlgorithm.CConfiguration.getChromosomeSize ( )

Returns the size of a chromosome that will be used by this genetic algorithm.

Returns:
The chromosome size used in this configuration.
List<ICrossoverOperator> MCScheduling.GeneticAlgorithm.CConfiguration.getCrossoverOperators ( )

Returns the crossover operators setup in this configuration.

The returned list should NOT be modified.

Returns:
The list of crossover operators.
IFitnessComparer MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessComparer ( )

Returns the fitness comparer that is used in this configuration.

Returns:
the fitness comparer that is used in this configuration.
IFitnessEvaluator MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessEvaluator ( )

Returns the fitness comparer used in this configuration.

Returns:
The fitness comparer used in this configuration.
IFitnessScaler MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessScaler ( )

Returns the fitness scaler that is used in this configuration.

Returns:
the fitness scaler that is used in this configuration.
IGeneDistanceMeasurer MCScheduling.GeneticAlgorithm.CConfiguration.getGeneDistanceMeasurer ( )

Returns the gene distance measurer that is used in this configuration.

Returns:
the gene distance measurer that is used in this configuration.
List<IMutationOperator> MCScheduling.GeneticAlgorithm.CConfiguration.getMutationOperators ( )

Returns the mutation operators setup in this configuration.

The returned list should NOT be modified.

Returns:
The list of mutation operators.
String MCScheduling.GeneticAlgorithm.CConfiguration.getName ( )

Returns the name of the configuration.

Returns:
The user-specific name of the configuration.
ISelectionOperator MCScheduling.GeneticAlgorithm.CConfiguration.getNaturalSelector ( )

Returns the natural selector that is used in this configuration.

Returns:
The natural selector used in thie configuration.
int MCScheduling.GeneticAlgorithm.CConfiguration.getNumberOfFittestToCopy ( )

Returns the number of fittest chromosomes that is being always copied into the mating pool.

Returns:
A number of chromosomes being copied.
int MCScheduling.GeneticAlgorithm.CConfiguration.getPopulationSize ( )

Returns the population size.

Returns:
The size of the population.
IRandomizer MCScheduling.GeneticAlgorithm.CConfiguration.getRandomGenerator ( )

Returns the pseudo-random number generator that is used by this configuration.

Returns:
The random number generator.
double MCScheduling.GeneticAlgorithm.CConfiguration.getTolerance ( )

Returns the maximum allowed difference of two decimals in which are considered as being the same.

Returns:
A tolerance.
void MCScheduling.GeneticAlgorithm.CConfiguration.removeCrossoverOperator ( ICrossoverOperator  crossoverOperator)

Removes the specified crossover operator from the list of genetic operators used by this genetic algorithm.

If the operator is not present in the list, nothing happens.

Parameters:
crossoverOperatorThe crossover operator to be removed.
Exceptions:
ArgumentNullExceptionIf the crossoverOperator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.removeMutationOperator ( IMutationOperator  mutationOperator)

Removes the specified mutation operator from the list of genetic operators used by this genetic algorithm.

If the operator is not present in the list, nothing happens.

Parameters:
mutationOperatorThe mutation operator to be removed.
Exceptions:
ArgumentNullExceptionIf the mutationOperator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.serialize ( string  filePath)

Serializes this configuration into the specified file.

Parameters:
filePathThe path to a file where this configuration is going to be serialized.
void MCScheduling.GeneticAlgorithm.CConfiguration.setBreeder ( CBaseBreeder  breeder)

Sets the breeder to be used in this configuration.

Parameters:
breederThe breeder to be set up for this configuration.
Exceptions:
ArgumentNullExceptionIf breeder is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setChromosomePool ( IChromosomePool  chromosomePool)

Sets the chromosome pool that will be used by this configuration.

Parameters:
chromosomePoolThe chromosome pool to be used.
void MCScheduling.GeneticAlgorithm.CConfiguration.setChromosomeSize ( int  chromosomeSize)

Sets the size of a chromosome that will be used by this genetic algorithm.

Parameters:
chromosomeSizeA chromosome size.
void MCScheduling.GeneticAlgorithm.CConfiguration.setFitnessComparer ( IFitnessComparer  fitnessComparer)

Sets the fitness comparer for this configuration.

The fitness comparer determines the ordering of the fitness values.

Parameters:
fitnessComparerThe fitness comparer to be set up.
Exceptions:
ArgumentNullExceptionIf fitnessComparer is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setFitnessEvaluator ( IFitnessEvaluator  fitnessEvaluator)

Sets the fitness evaluator that will be used by this genetic algorithm.

The fitness evaluator determines for each of the chromosome in the population how good he is in solving the given problem, this value is so called fitness.

Parameters:
fitnessEvaluatorThe fitness evaluator to be set up.
Exceptions:
ArgumentNullExceptionIf the fitnessEvaluator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setFitnessScaler ( IFitnessScaler  fitnessScaler)

Sets the fitness scaler for this configuration.

The fitness scaler is used to scale raw fitness scores.

Parameters:
fitnessScalerThe fitness scaler to be set up.
Exceptions:
ArgumentNullExceptionIf fitnessScaler is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setGeneDistanceMeasurer ( IGeneDistanceMeasurer  geneDistanceMeasurer)

Sets the gene distance measurer for this configuration.

The gene distance measurer is used to determine the distance between pair of genes.

Parameters:
geneDistanceMeasurerThe gene distance measurer to be set up.
Exceptions:
ArgumentNullExceptionIf gene distance measurer is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setName ( String  configurationName)

Sets the name for this configuration.

Parameters:
configurationNameThe user-specific name for the configuration.
void MCScheduling.GeneticAlgorithm.CConfiguration.setNaturalSelector ( ISelectionOperator  naturalSelector)

Sets the natural selector to be used for this genetic algorithm.

For more information about natural selectors see description of the INaturalSelector public interface.

Parameters:
naturalSelectorThe natural selector to be set up.
Exceptions:
ArgumentNullExceptionIf the naturalSelector is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setNumberOfFittestToCopy ( int  numberOfFittestToCopy)

Sets the number of fittest chromosomes that will be always copied into the mating pool.

Parameters:
numberOfFittestToCopyThe number of chromosomes to be copied.
void MCScheduling.GeneticAlgorithm.CConfiguration.setPopulationSize ( int  populationSize)

Sets up the population size that will be used by this genetic algorithm.

The population size represents the number of chromosomes contained within a genotype.

Parameters:
populationSizeThe population size value to be set.
Exceptions:
ArgumentOutOfRangeExceptionIf the population size is less then 1.
void MCScheduling.GeneticAlgorithm.CConfiguration.setRandomGenerator ( IRandomizer  randomGenerator)

Sets the pseudo-random number generator that will be used by this algorithm.

Parameters:
randomGeneratorThe random number generator to be used.
Exceptions:
ArgumentNullExceptionIf randomGenerator is null.
void MCScheduling.GeneticAlgorithm.CConfiguration.setTolerance ( double  tolerance)

Sets the maximum allowed difference of two decimals in which are considered as being the same.

Parameters:
toleranceA new tolerance value.
 All Classes Namespaces Functions Variables Properties