Betty 1.1
es.us.isa.generator.FM.Evolutionay.Chromosome Class Reference
Inheritance diagram for es.us.isa.generator.FM.Evolutionay.Chromosome:
es.us.isa.generator.FM.Evolutionay.IChromosome

List of all members.

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

Detailed Description

This class contains the based methods to encode and decode feature models as chromosomes.


Member Function Documentation

boolean es.us.isa.generator.FM.Evolutionay.Chromosome.areDirectFamily ( Feature  f,
Feature  g 
) [protected]

Check if f and g are direct family

Parameters:
fA feature
gA feature
Returns:
a boolean telling if are Direct Family
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.

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

Returns:
the list of existing CTC

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

Returns:
The name of the feature
String es.us.isa.generator.FM.Evolutionay.Chromosome.getRelationId ( ) [protected]

Generate an id for the following relation

Returns:
the name of the relation
List<String[]> es.us.isa.generator.FM.Evolutionay.Chromosome.getTree ( )

Return a list with the encoded feature model tree.

Returns:
The list of Features

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

Parameters:
ffthe fitness of the chomosome

Implements es.us.isa.generator.FM.Evolutionay.IChromosome.

String es.us.isa.generator.FM.Evolutionay.Chromosome.toString ( )

Output string


Member Data Documentation

Map<Feature, List<Feature> > es.us.isa.generator.FM.Evolutionay.Chromosome.altRelationships [protected]

Intermediate structure for decoding alternative relationships

CTC encoding

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.

Save the position in the array of each feature

Random class to be used along the generation

Seed for the genrtation of the first chromosomes

Feature tree encoding


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables