Search in sources :

Example 1 with MinimizerQuineMcCluskeyExam

use of de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam 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);
    }
}
Also used : ComplexityVisitor(de.neemann.digital.analyse.expression.ComplexityVisitor) MinimizerQuineMcCluskeyExam(de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam) ExpressionListenerStore(de.neemann.digital.gui.components.table.ExpressionListenerStore)

Example 2 with MinimizerQuineMcCluskeyExam

use of de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam in project Digital by hneemann.

the class MinimizerRegressionTest method testQuineMcCluskeyExam.

public void testQuineMcCluskeyExam() throws ExpressionException, FormatterException {
    MinimizerInterface m = new MinimizerQuineMcCluskeyExam();
    performTests(m);
}
Also used : MinimizerInterface(de.neemann.digital.analyse.MinimizerInterface) MinimizerQuineMcCluskeyExam(de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam)

Example 3 with MinimizerQuineMcCluskeyExam

use of de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam in project Digital by hneemann.

the class QuineMcCluskeyExamTest method testMinimal.

public void testMinimal() throws ExpressionException, FormatterException {
    ExpressionListenerStore results = new ExpressionListenerStore(null);
    new MinimizerQuineMcCluskeyExam().minimize(Variable.vars(4), new BoolTableByteArray(new byte[] { 1, 2, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1 }), "Y", results);
    assertEquals(1, results.getResults().size());
}
Also used : MinimizerQuineMcCluskeyExam(de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam) ExpressionListenerStore(de.neemann.digital.gui.components.table.ExpressionListenerStore)

Aggregations

MinimizerQuineMcCluskeyExam (de.neemann.digital.analyse.MinimizerQuineMcCluskeyExam)3 ExpressionListenerStore (de.neemann.digital.gui.components.table.ExpressionListenerStore)2 MinimizerInterface (de.neemann.digital.analyse.MinimizerInterface)1 ComplexityVisitor (de.neemann.digital.analyse.expression.ComplexityVisitor)1