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;
});
}
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;
}
Aggregations