Search in sources :

Example 1 with PrimeSelector

use of de.neemann.digital.analyse.quinemc.primeselector.PrimeSelector in project Digital by hneemann.

the class MinimizerQuineMcCluskey method minimize.

@Override
public void minimize(List<Variable> vars, BoolTable boolTable, String resultName, ExpressionListener listener) throws ExpressionException, FormatterException {
    QuineMcCluskey qmc = createQuineMcCluskey(vars).fillTableWith(boolTable);
    PrimeSelector ps = new PrimeSelectorDefault();
    Expression e = qmc.simplify(ps).getExpression();
    if (ps.getAllSolutions() != null) {
        for (ArrayList<TableRow> i : ps.getAllSolutions()) {
            listener.resultFound(resultName, QuineMcCluskey.addAnd(null, i, vars));
        }
    } else {
        listener.resultFound(resultName, e);
    }
}
Also used : QuineMcCluskey(de.neemann.digital.analyse.quinemc.QuineMcCluskey) PrimeSelectorDefault(de.neemann.digital.analyse.quinemc.primeselector.PrimeSelectorDefault) Expression(de.neemann.digital.analyse.expression.Expression) TableRow(de.neemann.digital.analyse.quinemc.TableRow) PrimeSelector(de.neemann.digital.analyse.quinemc.primeselector.PrimeSelector)

Aggregations

Expression (de.neemann.digital.analyse.expression.Expression)1 QuineMcCluskey (de.neemann.digital.analyse.quinemc.QuineMcCluskey)1 TableRow (de.neemann.digital.analyse.quinemc.TableRow)1 PrimeSelector (de.neemann.digital.analyse.quinemc.primeselector.PrimeSelector)1 PrimeSelectorDefault (de.neemann.digital.analyse.quinemc.primeselector.PrimeSelectorDefault)1