Search in sources :

Example 1 with Operator

use of nars.concept.Operator in project narchy by automenta.

the class Opjects method reflect.

private MethodExec reflect(Method m) {
    if (!validMethod(m))
        return null;
    m.setAccessible(true);
    String n = m.getName();
    return opCache.computeIfAbsent(n, (mn) -> {
        MethodExec methodExec = new MethodExec(mn);
        Operator op = nar.onOp(mn, methodExec);
        methodExec.operator = op;
        return methodExec;
    });
}
Also used : Operator(nars.concept.Operator)

Example 2 with Operator

use of nars.concept.Operator in project narchy by automenta.

the class NAR method onOp.

/**
 * registers an operator
 */
public final Operator onOp(@NotNull Atom a, @NotNull BiFunction<Task, NAR, Task> exe) {
    Operator op;
    concepts.set(op = new Operator(a, exe, this));
    return op;
}
Also used : Operator(nars.concept.Operator)

Aggregations

Operator (nars.concept.Operator)2