MCScheduling 1.0
Set of Algorithms for Solving Mixed-Criticality Scheduling
|
The configuration represents a setting of a genetic algorithm, i.e. More...
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< ICrossoverOperator > | getCrossoverOperators () |
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< IMutationOperator > | getMutationOperators () |
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. |
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.
MCScheduling.GeneticAlgorithm.CConfiguration.CConfiguration | ( | String | configurationName | ) |
Creates a default configuration with the specified name.
configurationName | The user-specific name for the configuration. |
MCScheduling.GeneticAlgorithm.CConfiguration.CConfiguration | ( | String | configurationFilePath, |
int | ignore | ||
) |
Reads in the configuration from the specified file.
configurationFilePath | The file from which the configuration will be created. |
ignore | An ignored parameter. |
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.
crossoverOperator | The crossover operator to be added. |
ArgumentNullException | If 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.
mutationOperator | The crossover operator to be added. |
ArgumentNullException | If 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.
filePath | The path where the configuration is going to be deserialized from. |
CBaseBreeder MCScheduling.GeneticAlgorithm.CConfiguration.getBreeder | ( | ) |
Returns the breeder that is used by this configuration.
IChromosomePool MCScheduling.GeneticAlgorithm.CConfiguration.getChromosomePool | ( | ) |
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.
List<ICrossoverOperator> MCScheduling.GeneticAlgorithm.CConfiguration.getCrossoverOperators | ( | ) |
Returns the crossover operators setup in this configuration.
The returned list should NOT be modified.
IFitnessComparer MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessComparer | ( | ) |
Returns the fitness comparer that is used in this configuration.
IFitnessEvaluator MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessEvaluator | ( | ) |
Returns the fitness comparer used in this configuration.
IFitnessScaler MCScheduling.GeneticAlgorithm.CConfiguration.getFitnessScaler | ( | ) |
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.
List<IMutationOperator> MCScheduling.GeneticAlgorithm.CConfiguration.getMutationOperators | ( | ) |
Returns the mutation operators setup in this configuration.
The returned list should NOT be modified.
String MCScheduling.GeneticAlgorithm.CConfiguration.getName | ( | ) |
Returns the name of the configuration.
ISelectionOperator MCScheduling.GeneticAlgorithm.CConfiguration.getNaturalSelector | ( | ) |
Returns the natural selector that is used in this configuration.
int MCScheduling.GeneticAlgorithm.CConfiguration.getNumberOfFittestToCopy | ( | ) |
Returns the number of fittest chromosomes that is being always copied into the mating pool.
int MCScheduling.GeneticAlgorithm.CConfiguration.getPopulationSize | ( | ) |
Returns the population size.
IRandomizer MCScheduling.GeneticAlgorithm.CConfiguration.getRandomGenerator | ( | ) |
Returns the pseudo-random number generator that is used by this configuration.
double MCScheduling.GeneticAlgorithm.CConfiguration.getTolerance | ( | ) |
Returns the maximum allowed difference of two decimals in which are considered as being the same.
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.
crossoverOperator | The crossover operator to be removed. |
ArgumentNullException | If 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.
mutationOperator | The mutation operator to be removed. |
ArgumentNullException | If the mutationOperator is null. |
void MCScheduling.GeneticAlgorithm.CConfiguration.serialize | ( | string | filePath | ) |
Serializes this configuration into the specified file.
filePath | The 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.
breeder | The breeder to be set up for this configuration. |
ArgumentNullException | If breeder is null. |
void MCScheduling.GeneticAlgorithm.CConfiguration.setChromosomePool | ( | IChromosomePool | chromosomePool | ) |
Sets the chromosome pool that will be used by this configuration.
chromosomePool | The 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.
chromosomeSize | A 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.
fitnessComparer | The fitness comparer to be set up. |
ArgumentNullException | If 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.
fitnessEvaluator | The fitness evaluator to be set up. |
ArgumentNullException | If 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.
fitnessScaler | The fitness scaler to be set up. |
ArgumentNullException | If 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.
geneDistanceMeasurer | The gene distance measurer to be set up. |
ArgumentNullException | If gene distance measurer is null. |
void MCScheduling.GeneticAlgorithm.CConfiguration.setName | ( | String | configurationName | ) |
Sets the name for this configuration.
configurationName | The 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.
naturalSelector | The natural selector to be set up. |
ArgumentNullException | If 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.
numberOfFittestToCopy | The 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.
populationSize | The population size value to be set. |
ArgumentOutOfRangeException | If 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.
randomGenerator | The random number generator to be used. |
ArgumentNullException | If 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.
tolerance | A new tolerance value. |