Esempio n. 1
0
  /**
   * Transform a cardinality-based feature model into a constraint model.
   *
   * @param featuremodel
   */
  public Model getCSPModel(FeatureModel featuremodel) {
    Feature rootFeature = featuremodel.getRoot();
    // according to Benavides2005 transform fm into csp model
    transformFeature(rootFeature);

    transformConstraints(featuremodel);
    return cspModel;
  }
Esempio n. 2
0
 private void transformConstraints(FeatureModel model) {
   EList<org.js.model.feature.Constraint> constraints = model.getConstraints();
   for (org.js.model.feature.Constraint constraint : constraints) {
     Constraint chocoConstraint = createCrossTreeConstraint(constraint);
     if (chocoConstraint != null) {
       getModel().addConstraint(chocoConstraint);
     }
   }
 }