use of nars.concept.Concept in project narchy by automenta.
the class TermTest method testTermEquality.
protected void testTermEquality(@NotNull String s, boolean conceptualize) throws Narsese.NarseseException {
Term a = $.$(s).term();
NAR n2 = NARS.shell();
Term b = $.$(s).term();
if (a instanceof Compound) {
assertEquals(a.subterms(), b.subterms());
}
assertEquals(a.hashCode(), b.hashCode());
assertEquals(a.toString(), b.toString());
assertEquals(a, b);
assertEquals(a.compareTo(a), a.compareTo(b));
assertEquals(0, b.compareTo(a));
if (conceptualize) {
Concept n2a = n2.conceptualize(a);
assertNotNull(n2a, a + " should conceptualize");
assertNotNull(b);
assertEquals(n2a.toString(), b.toString());
assertEquals(n2a.hashCode(), b.hashCode());
assertEquals(n2a.term(), b);
}
}
use of nars.concept.Concept in project narchy by automenta.
the class TaskTest method testValid.
@Test
public void testValid() throws Narsese.NarseseException {
NAR tt = NARS.shell();
Task t = $.task("((&&,#1,(#1 &&+0 #3),(#2 &&+0 #3),(#2 &&+0 (toothbrush-->here))) ==>+0 lighter(I,toothbrush))", BELIEF, 1f, 0.9f).apply(tt);
assertNotNull(t);
Concept c = t.concept(tt, true);
assertNotNull(c);
}
Aggregations