public class ModelPLEDGE
extends java.util.Observable
| Modifier and Type | Class and Description |
|---|---|
static class |
ModelPLEDGE.FeatureModelFormat |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NOT |
static java.lang.String |
OR |
| Constructor and Description |
|---|
ModelPLEDGE()
Creates the model of the application.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateProducts()
Generate products.
|
java.util.List<java.lang.String> |
getCoreFeatures()
Returns the core features of the feature model.
|
java.lang.String |
getCurrentAction()
Returns the current action performed by the tool.
|
java.util.List<java.lang.String> |
getDeadFeatures()
Returns the dead features of the feature model.
|
java.util.List<org.sat4j.specs.IConstr> |
getFeatureModelConstraints()
Returns the constraints of the feature model.
|
java.util.List<java.lang.String> |
getFeatureModelConstraintsString()
Returns the constraints of the feature model.
|
ModelPLEDGE.FeatureModelFormat |
getFeatureModelFormat()
Returns the format of the currently loaded feature model.
|
java.lang.String |
getFeatureModelName()
Returns the name of the currently loaded feature model.
|
java.util.List<java.lang.Integer> |
getFeaturesIntList()
Returns an indices list of the features.
|
java.util.List<java.lang.String> |
getFeaturesList()
returns the features' list of the feature model.
|
java.lang.String |
getFeatureType(java.lang.String feature)
Return the type of a given feature (i.e. core, dead or free)
|
GenerationTechnique |
getGenerationTechnique()
Returns the specified generation technique.
|
java.util.List<GenerationTechnique> |
getGenerationTechniques()
Returns the generation techniques available.
|
long |
getGenerationTimeMSAllowed()
Returns the amount of time allowed for generating products.
|
java.lang.String |
getGlobalAction()
Returns the current global action performed by the tool.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getNamesToFeaturesInt()
Returns a mapping between each feature and its corresponding index.
|
int |
getNbProductsToGenerate()
Returns the number of products to generate.
|
PrioritizationTechnique |
getPrioritizationTechnique()
Returns the specified prioritization technique.
|
java.util.List<PrioritizationTechnique> |
getPrioritizationTechniques()
Returns the prioritization techniques available.
|
java.util.List<Product> |
getProducts()
Returns the list of products currently loaded into the application.
|
int |
getProgress()
Return the progress of the current action performed by the tool (percentage)
|
org.sat4j.minisat.core.Solver |
getSolver()
Returns the SAT solver.
|
org.sat4j.specs.ISolver |
getSolverIterator()
Returns the solver iterator that is used to generate valid products.
|
java.util.List<Product> |
getUnpredictableProducts(int count)
returns n products obtained at random from the solver.
|
boolean |
isIndeterminate()
Specifies whether the duration of current action performed by the tool is indeterminate or not.
|
boolean |
isRunning()
Checks if the application is running.
|
void |
loadFeatureModel(java.lang.String filePath,
ModelPLEDGE.FeatureModelFormat format)
Load a feature model.
|
void |
loadProducts(java.lang.String inFile)
Load products from a file.
|
void |
prioritizeProducts()
Prioritize products.
|
void |
quit()
Quit the application.
|
void |
saveProducts(java.lang.String outFile)
Save products to a file.
|
void |
setCurrentAction(java.lang.String currentAction)
Specifies the current action performed by the tool.
|
void |
SetGenerationTechniqueByName(java.lang.String name)
Specifies the generation technique used by the tool.
|
void |
setGenerationTimeMSAllowed(long generationTimeMSAllowed)
Specifies the amount of time allowed for generating products.
|
void |
setGlobalAction(java.lang.String globalAction)
Specifies the current global action performed by the tool.
|
void |
setIndeterminate(boolean indeterminate)
Specifies wether the duration of current action performed by the tool is indeterminate or not.
|
void |
setNbProductsToGenerate(int nbProductsToGenerate)
Specifies the number of products to generate.
|
void |
SetPrioritizationTechniqueByName(java.lang.String name)
Specifies the prioritization technique used by the tool.
|
void |
setProgress(int progress)
Specifies the progress of the current action performed by the tool (percentage)
|
void |
setRunning(boolean running)
Specifies whether the application is running or not.
|
public static final java.lang.String OR
public static final java.lang.String NOT
public ModelPLEDGE.FeatureModelFormat getFeatureModelFormat()
public java.lang.String getFeatureModelName()
public java.util.List<java.lang.Integer> getFeaturesIntList()
public java.util.List<java.lang.String> getFeaturesList()
public java.util.Map<java.lang.String,java.lang.Integer> getNamesToFeaturesInt()
public java.util.List<org.sat4j.specs.IConstr> getFeatureModelConstraints()
public java.util.List<java.lang.String> getFeatureModelConstraintsString()
public org.sat4j.minisat.core.Solver getSolver()
public boolean isRunning()
public java.util.List<Product> getProducts()
public long getGenerationTimeMSAllowed()
public void setGenerationTimeMSAllowed(long generationTimeMSAllowed)
generationTimeMSAllowed - the amount of time in seconds allowed for generating products.public int getNbProductsToGenerate()
public void setNbProductsToGenerate(int nbProductsToGenerate)
nbProductsToGenerate - the number of products to generate.public void setRunning(boolean running)
running - a boolean indicating whether the application is running or not.public boolean isIndeterminate()
public int getProgress()
public void setProgress(int progress)
progress - an integer representing the percentage of the current action performed.public void setIndeterminate(boolean indeterminate)
indeterminate - a boolean specifying wether the duration of current action performed by the tool is indeterminate or not.public org.sat4j.specs.ISolver getSolverIterator()
public java.lang.String getCurrentAction()
public void setCurrentAction(java.lang.String currentAction)
currentAction - a String representing the action which is currently performed by the tool.public java.lang.String getGlobalAction()
public void setGlobalAction(java.lang.String globalAction)
globalAction - a String representing the global action which is currently performed by the tool.public java.util.List<java.lang.String> getCoreFeatures()
public java.util.List<java.lang.String> getDeadFeatures()
public GenerationTechnique getGenerationTechnique()
public void SetGenerationTechniqueByName(java.lang.String name)
name - the name of the generation technique that has to be used to generate products.public java.util.List<GenerationTechnique> getGenerationTechniques()
public PrioritizationTechnique getPrioritizationTechnique()
public void SetPrioritizationTechniqueByName(java.lang.String name)
name - the name of the prioritization technique that has to be used to prioritize products.public java.util.List<PrioritizationTechnique> getPrioritizationTechniques()
public void loadFeatureModel(java.lang.String filePath,
ModelPLEDGE.FeatureModelFormat format)
throws java.lang.Exception
filePath - the path to the feature model file.format - the format of the feature model.java.lang.Exception - if the file format is incorrect.public void generateProducts()
throws java.lang.Exception
java.lang.Exception - if an error occurs during the generation.public void prioritizeProducts()
throws java.lang.Exception
java.lang.Exception - if an error occur while prioritizing the products.public java.lang.String getFeatureType(java.lang.String feature)
feature - the name of the feature.public java.util.List<Product> getUnpredictableProducts(int count)
count - the number of products to get.public void saveProducts(java.lang.String outFile)
throws java.lang.Exception
outFile - the file to write the products in.java.lang.Exception - if an error occurs while writing the products to the file.public void loadProducts(java.lang.String inFile)
throws java.lang.Exception
inFile - the file to loead the products from.java.lang.Exception - if an error occurs while reading the products file.public void quit()