}
}
public Map<String, Double> findFuzzyModel() {
for (int numberOfDegrees = 1;!timesUp(); numberOfDegrees++) {
EnumeratedChocoSolver solv = new EnumeratedChocoSolver(numberOfDegrees, new HashMap(),k);
for (FuzzyClause fc : constraints) {
solv.addFuzzyClause(fc);
}
/*Map<String, Double> model = solv.getModel();
model.putAll(trivialAssignments);
if (model != null){
return model;
}*/
// // Safer code added by Jeroen:
// Map<String, Double> model = solv.getModel();
// if (!trivialAssignments.isEmpty()) {
// if (model == null) {
// model = new HashMap<String, Double>();
// }
// model.putAll(trivialAssignments);
// return model;
// }
Map<String, Double> model = solv.getModel();
if (model!=null) {
model.putAll(trivialAssignments);
return model;
}
}