Search in sources :

Example 21 with Subterms

use of nars.subterm.Subterms in project narchy by automenta.

the class TermTest method testHashConsistent.

@Test
public void testHashConsistent() {
    Term x = $.the("z");
    Subterms a = new UnitSubterm(x);
    Subterms b = new ArrayTermVector(x);
    assertEquals(a, b);
    assertEquals(a.hashCode(), b.hashCode());
    assertEquals(a.hashCodeSubterms(), b.hashCodeSubterms());
    assertEquals(a.toString(), b.toString());
}
Also used : Subterms(nars.subterm.Subterms) UnitSubterm(nars.subterm.UnitSubterm) ArrayTermVector(nars.subterm.ArrayTermVector) Test(org.junit.jupiter.api.Test)

Aggregations

Subterms (nars.subterm.Subterms)21 Op (nars.Op)11 Term (nars.term.Term)9 Nullable (org.jetbrains.annotations.Nullable)7 java.util (java.util)3 Predicate (java.util.function.Predicate)3 TODO (jcog.TODO)3 FasterList (jcog.list.FasterList)3 Bool (nars.term.atom.Bool)3 LongObjectPair (org.eclipse.collections.api.tuple.primitive.LongObjectPair)3 Iterables (com.google.common.collect.Iterables)2 Iterators (com.google.common.collect.Iterators)2 Multimap (com.google.common.collect.Multimap)2 MultimapBuilder (com.google.common.collect.MultimapBuilder)2 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)2 Consumer (java.util.function.Consumer)2 Util (jcog.Util)2 ImmutableDirectedEdge (jcog.data.graph.ImmutableDirectedEdge)2 MapNodeGraph (jcog.data.graph.MapNodeGraph)2 Search (jcog.data.graph.search.Search)2