Search in sources :

Example 1 with Prioritized

use of jcog.pri.Prioritized in project narchy by automenta.

the class Abbreviation method accept.

@Override
public void accept(NAR nar, Task task) {
    Term taskTerm = task.term();
    if ((!(taskTerm instanceof Compound)) || taskTerm.vars() > 0)
        return;
    Prioritized b = task;
    input(b, bag.bag::put, (Compound) taskTerm, 1f, nar);
}
Also used : Prioritized(jcog.pri.Prioritized) Compound(nars.term.Compound) Term(nars.term.Term)

Example 2 with Prioritized

use of jcog.pri.Prioritized in project narchy by automenta.

the class PriMergeTest method testMerge.

private static Prioritized testMerge(Priority x, Prioritized y, @NotNull PriMerge m, float ouPri, float expectedOverflow) {
    x = x.clonePri();
    Prioritized x0 = x.clonePri();
    float overflow = m.merge(x, y);
    System.out.println(x0 + " <-merge<- " + y + " x " + "\t\texpect:" + new Pri(ouPri) + " ?? actual:" + x);
    assertEquals(ouPri, x.pri(), tol);
    if (expectedOverflow > 0)
        assertEquals(expectedOverflow, overflow, 0.01f);
    return x;
}
Also used : Prioritized(jcog.pri.Prioritized) Pri(jcog.pri.Pri)

Aggregations

Prioritized (jcog.pri.Prioritized)2 Pri (jcog.pri.Pri)1 Compound (nars.term.Compound)1 Term (nars.term.Term)1