Betty 1.1
es.us.isa.generator.FM.AbstractFMGenerator Class Reference
Inheritance diagram for es.us.isa.generator.FM.AbstractFMGenerator:
es.us.isa.generator.IGenerator es.us.isa.generator.FM.Evolutionay.EvolutionaryFMGenerator es.us.isa.generator.FM.FMGenerator

List of all members.

Public Member Functions

void resetGenerator (Characteristics c) throws BettyException
void setHookClass (AbstractFMGeneratorDecorator gen)
void addRoot (FAMAFeatureModel fm, Feature root)
Relation addAlternative (Feature parent, List< Feature > children)
void addMandatory (Feature parent, Feature child)
void addOptional (Feature parent, Feature child)
Relation addOr (Feature parent, List< Feature > children)
void addExcludes (FAMAFeatureModel fm, Feature origin, Feature destination)
void addRequires (FAMAFeatureModel fm, Feature origin, Feature destination)
boolean areDirectFamily (Feature f, Feature g)
boolean existsRelation (FAMAFeatureModel fm, Feature f, Feature g)
void createCardinality (Feature parent, Feature child, int i, int j)

Protected Member Functions

String getFeatureId ()
String getRelationId ()

Protected Attributes

AbstractFMGeneratorDecorator hookClass = null
GeneratorCharacteristics characteristics
FMStatistics statistics
Random random
int numberOfFeatures
int numberOfConstraints
float probMandatory
float probOptional
float probOrChildren
float probAltChildren
int featureId
int relationId

Detailed Description

This class implements the basic methods of a basic random FM generator.


Member Function Documentation

Relation es.us.isa.generator.FM.AbstractFMGenerator.addAlternative ( Feature  parent,
List< Feature >  children 
)

Update the statistics of the feature model being generated when we add an alternative relationship.

Parameters:
parentThe parent feature of the alternative relationship.
childrenThe child features of the alternative relationship.
void es.us.isa.generator.FM.AbstractFMGenerator.addExcludes ( FAMAFeatureModel  fm,
Feature  origin,
Feature  destination 
)

Update the statistics of the feature model being generated when an excludes constraint is added.

Parameters:
originThe origin feature.
destinationThe destination feature.
void es.us.isa.generator.FM.AbstractFMGenerator.addMandatory ( Feature  parent,
Feature  child 
)

Update the statistics of the feature model being generated when we add an mandatory relationship

Parameters:
parentThe parent feature of the mandatory relationship.
childThe mandatory feature added.
void es.us.isa.generator.FM.AbstractFMGenerator.addOptional ( Feature  parent,
Feature  child 
)

Update the statistics of the feature model being generated when we add an optional relationship

Parameters:
parentThe parent feature of the optional relationship.
childThe optional feature added.
Relation es.us.isa.generator.FM.AbstractFMGenerator.addOr ( Feature  parent,
List< Feature >  children 
)

Update the statistics of the feature model being generated when we add an or relationship.

Parameters:
parentThe parent feature of the or-relation.
childrenThe child features of the or-relation added.
void es.us.isa.generator.FM.AbstractFMGenerator.addRequires ( FAMAFeatureModel  fm,
Feature  origin,
Feature  destination 
)

Update the statistics of the feature model being generated when a requires constraint is added.

Parameters:
originThe origin feature.
destinationThe destination feature.
void es.us.isa.generator.FM.AbstractFMGenerator.addRoot ( FAMAFeatureModel  fm,
Feature  root 
)

Update the statistics of the feature model being generated when we add a root feature.

Parameters:
rootThe root feature added.
boolean es.us.isa.generator.FM.AbstractFMGenerator.areDirectFamily ( Feature  f,
Feature  g 
)

This method is used to find out if two features are direct family (i.e. they are directly related in the tree) For instance, in the following scheme, f->h->i->g, we could say that f and g are direct family.

Parameters:
fThis first feature whose parental relation we want to check.
gThis second feature whose parental relation we want to check.
Returns:
a boolean stating whether the input features have any parental relation or not.
void es.us.isa.generator.FM.AbstractFMGenerator.createCardinality ( Feature  parent,
Feature  child,
int  i,
int  j 
)

This method create a relation with complex cardinality between two features

Parameters:
parentThe parent feature.
childThe child feature.
iThe minimum value for the cardinality.
jThe maximum value for the cardinality.
boolean es.us.isa.generator.FM.AbstractFMGenerator.existsRelation ( FAMAFeatureModel  fm,
Feature  f,
Feature  g 
)

This method will look for any existing dependency in the generated model between the input features

Parameters:
fmThe feature model where we will look for the dependency
fInput feature.
gInput feature.
Returns:
a boolean stating whether exits a constraint in fm between f and g or not.
String es.us.isa.generator.FM.AbstractFMGenerator.getFeatureId ( ) [protected]
Returns:
the next name to be used for a new feature
String es.us.isa.generator.FM.AbstractFMGenerator.getRelationId ( ) [protected]
Returns:
the next name to be used for a new relation
void es.us.isa.generator.FM.AbstractFMGenerator.resetGenerator ( Characteristics  c) throws BettyException

This method resets the generation, setting the user's preferences for the generation

Parameters:
cThe characteristics (user's generation preferences) to be used in the generator.
Exceptions:
BettyException

Implements es.us.isa.generator.IGenerator.

void es.us.isa.generator.FM.AbstractFMGenerator.setHookClass ( AbstractFMGeneratorDecorator  gen)

Set a decorator object implementing the hook methods


Member Data Documentation

Input constraints used for the generation.

This variable is used to add functionality to the internal methods of the class by using hook methods implemented in an external decorator class. By default is null.

Number of cross-tree constraints to be generated

Number of features of the feature models to be generated

Probability of a feature being in an alternative relation

Probability of a feature being mandatory

Probability of a feature being optional.

Probability of a feature being in an or-relation

The random class used during the generation.

This variable stores the statistics of the model being generated (e.g. number of features generated)


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