use of de.neemann.digital.analyse.expression.ComplexityVisitor in project Digital by hneemann.
the class QuineMcCluskeyExamTest method testMultipleSolutions.
public void testMultipleSolutions() throws ExpressionException, FormatterException {
ExpressionListenerStore results = new ExpressionListenerStore(null);
new MinimizerQuineMcCluskeyExam().minimize(Variable.vars(4), new BoolTableByteArray(new byte[] { 2, 0, 0, 0, 1, 2, 0, 0, 1, 1, 2, 0, 1, 1, 1, 2 }), "Y", results);
assertEquals(4, results.getResults().size());
int compl = -1;
for (ExpressionListenerStore.Result r : results.getResults()) {
assertEquals("Y", r.getName());
int c = r.getExpression().traverse(new ComplexityVisitor()).getComplexity();
if (compl < 0)
compl = c;
assertEquals(compl, c);
}
}
Aggregations