Betty 1.1
|
Public Member Functions | |
Chromosome (long seed, GeneratorCharacteristics ch) | |
Chromosome (List< String[]> tree, List< String[]> ctc, long seed, GeneratorCharacteristics ch) | |
void | encode (FAMAFeatureModel fm) |
FAMAFeatureModel | decode () |
List< String[]> | getTree () |
List< String[]> | getCTC () |
FMStatistics | getStatistics () |
Chromosome | clone () |
String | toString () |
void | setFitnessNumber (double ff) |
Public Attributes | |
double | fitness = 0 |
Protected Member Functions | |
boolean | areDirectFamily (Feature f, Feature g) |
boolean | existsRelation (FAMAFeatureModel fm, Feature f, Feature g) |
String | getFeatureId () |
String | getRelationId () |
void | createCardinality (Feature parent, Feature child, int i, int j) |
Protected Attributes | |
List< String[]> | tree |
List< String[]> | ctc |
Map< String, Integer > | positions |
int | position |
int | featureId |
int | relationId |
Map< String, Feature > | features |
Map< Feature, List< Feature > > | orRelationships |
Map< Feature, List< Feature > > | altRelationships |
FMStatistics | stats |
long | seed |
Random | rand |
GeneratorCharacteristics | characteristics |
This class contains the based methods to encode and decode feature models as chromosomes.
boolean es.us.isa.generator.FM.Evolutionay.Chromosome.areDirectFamily | ( | Feature | f, |
Feature | g | ||
) | [protected] |
Check if f and g are direct family
f | A feature |
g | A feature |
Chromosome es.us.isa.generator.FM.Evolutionay.Chromosome.clone | ( | ) |
Return a copy of the chromosome
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
FAMAFeatureModel es.us.isa.generator.FM.Evolutionay.Chromosome.decode | ( | ) |
Decode the chromosome
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
void es.us.isa.generator.FM.Evolutionay.Chromosome.encode | ( | FAMAFeatureModel | fm | ) |
Encoding. For the representation of feature models as chromosomes.
fm | The feature model to be encoded |
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
boolean es.us.isa.generator.FM.Evolutionay.Chromosome.existsRelation | ( | FAMAFeatureModel | fm, |
Feature | f, | ||
Feature | g | ||
) | [protected] |
Check if already exist a constraints between two features
List<String[]> es.us.isa.generator.FM.Evolutionay.Chromosome.getCTC | ( | ) |
Return the encoded list of the cross-tree constraints.
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
String es.us.isa.generator.FM.Evolutionay.Chromosome.getFeatureId | ( | ) | [protected] |
Generate and id for the following feature
String es.us.isa.generator.FM.Evolutionay.Chromosome.getRelationId | ( | ) | [protected] |
Generate an id for the following relation
List<String[]> es.us.isa.generator.FM.Evolutionay.Chromosome.getTree | ( | ) |
Return a list with the encoded feature model tree.
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
void es.us.isa.generator.FM.Evolutionay.Chromosome.setFitnessNumber | ( | double | ff | ) |
Set the fitness of the chromosome
ff | the fitness of the chomosome |
Implements es.us.isa.generator.FM.Evolutionay.IChromosome.
String es.us.isa.generator.FM.Evolutionay.Chromosome.toString | ( | ) |
Output string
Map<Feature, List<Feature> > es.us.isa.generator.FM.Evolutionay.Chromosome.altRelationships [protected] |
Intermediate structure for decoding alternative relationships
Input constraints for the generation
List<String[]> es.us.isa.generator.FM.Evolutionay.Chromosome.ctc [protected] |
CTC encoding
Map<String, Feature> es.us.isa.generator.FM.Evolutionay.Chromosome.features [protected] |
Features
Fitness (we save it to facilitate crossover)
Map<Feature, List<Feature> > es.us.isa.generator.FM.Evolutionay.Chromosome.orRelationships [protected] |
Intermediate structure for decoding or relationships.
int es.us.isa.generator.FM.Evolutionay.Chromosome.position [protected] |
Current position
Map<String, Integer> es.us.isa.generator.FM.Evolutionay.Chromosome.positions [protected] |
Save the position in the array of each feature
Random es.us.isa.generator.FM.Evolutionay.Chromosome.rand [protected] |
Random class to be used along the generation
long es.us.isa.generator.FM.Evolutionay.Chromosome.seed [protected] |
Seed for the genrtation of the first chromosomes
Decoding statistics
List<String[]> es.us.isa.generator.FM.Evolutionay.Chromosome.tree [protected] |
Feature tree encoding