use of nars.test.condition.TaskCondition in project narchy by automenta.
the class TestNAR method mustEmit.
@NotNull
TestNAR mustEmit(@NotNull Topic<Tasked>[] c, long cycleStart, long cycleEnd, @NotNull String sentenceTerm, byte punc, float freqMin, float freqMax, float confMin, float confMax, LongPredicate start, LongPredicate end, boolean must) throws Narsese.NarseseException {
if (freqMin == -1)
freqMin = freqMax;
int tt = temporalTolerance;
cycleStart -= tt;
cycleEnd += tt;
float hf = freqTolerance / 2.0f;
float hc = confTolerance / 2.0f;
TaskCondition tc = new TaskCondition(nar, cycleStart, cycleEnd, sentenceTerm, punc, freqMin - hf, freqMax + hf, confMin - hc, confMax + hc, start, end);
for (Topic<Tasked> cc : c) {
cc.on(tc);
}
finished = false;
if (must) {
succeedsIfAll.add(tc);
} else {
// require entire execution, not just finish early
exitOnAllSuccess = false;
failsIfAny.add(tc);
}
return this;
//
// ExplainableTask et = new ExplainableTask(tc);
// if (showExplanations) {
// explanations.add(et);
// }
// return et;
}
Aggregations