Search in sources :

Example 1 with AndCondition

use of nars.term.pred.AndCondition in project narchy by automenta.

the class DebugDerivationPredicate method onExit.

@Override
protected void onExit(PrediTerm<Derivation> p, Derivation d, boolean returnValue, Throwable thrown, long nanos) {
    if (p instanceof Fork || p instanceof AndCondition) {
    } else {
        Ansi.Color fg;
        if (p instanceof UnifyTerm) {
            fg = Ansi.Color.MAGENTA;
        } else {
            fg = Ansi.Color.YELLOW;
        }
        Ansi ansi = Ansi.ansi();
        String pAnsi = ansi.a(Texts.iPad(nanos, 6) + "nS ").a(' ').a(d.toString()).a(' ').fg(fg).a(p.toString()).fg(Ansi.Color.DEFAULT).a(' ').a((thrown != null ? (" " + thrown) : ' ')).fg(returnValue ? Ansi.Color.GREEN : Ansi.Color.RED).a(returnValue ? "TRUE" : "FALS").fg(Ansi.Color.DEFAULT).newline().toString();
        System.out.print(pAnsi);
    }
}
Also used : Fork(nars.term.pred.Fork) UnifyTerm(nars.derive.op.UnifyTerm) Ansi(org.fusesource.jansi.Ansi) AndCondition(nars.term.pred.AndCondition)

Aggregations

UnifyTerm (nars.derive.op.UnifyTerm)1 AndCondition (nars.term.pred.AndCondition)1 Fork (nars.term.pred.Fork)1 Ansi (org.fusesource.jansi.Ansi)1