use of jcog.pri.PLink in project narchy by automenta.
the class AtomicExec method apply.
@Override
@Nullable
public Task apply(Task x, NAR n) {
// TODO handle CMD's
Task y = exePrefilter(x);
if (y == null)
// pass-through to reasoner
return x;
if (y != x)
// transformed
return y;
x = y;
if (x.isCommand()) {
// immediately execute
exe.accept(x.term(), n);
// absorbed
return null;
} else {
active.put(new PLink(x.term().concept(), /* incase it contains temporal, we will dynamically match task anyway on invocation */
x.priElseZero()));
enable(n);
return x;
}
}
Aggregations