Search in sources :

Example 81 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL8EquivalenceTest method conjunctionSubstitutionViaEquivSimultaneous.

@Test
public void conjunctionSubstitutionViaEquivSimultaneous() {
    TestNAR tester = test;
    // ETERNAL or Zero, for now dont allow time relation
    tester.input("(a:b <=>+0 c:d).");
    // PRESENT
    tester.input("(c:d &&+0 e:f). :|:");
    tester.mustBelieve(cycles, "(a:b &&+0 e:f)", 1.0f, 0.81f, 0);
    tester.mustNotOutput(cycles, "(a:b &&+0 e:f)", BELIEF, ETERNAL);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 82 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL8Test method testDesiredConjPos.

@Test
public void testDesiredConjPos() {
    TestNAR t = test;
    t.believe("(x)").goal("((x)&&(y))").mustGoal(cycles, "(y)", 1f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) NALTest(nars.util.NALTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) NAL7Test(nars.nal.nal7.NAL7Test)

Example 83 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class NAL8Test method testBelievedImplOfDesire.

@Test
public void testBelievedImplOfDesire() {
    TestNAR t = test;
    t.goal("(x)").believe("((x)==>(y))").mustGoal(cycles, "(y)", 1f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) NALTest(nars.util.NALTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) NAL7Test(nars.nal.nal7.NAL7Test)

Example 84 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class BeliefTableTest method testDurationDithering.

@Test
public void testDurationDithering() {
    NAR n = NARS.tmp();
    n.dtDither.set(1f);
    n.time.dur(3);
    TestNAR t = new TestNAR(n);
    t.confTolerance(0.1f);
    t.inputAt(1, "x. :|:");
    t.inputAt(2, "y. :|:");
    t.mustBelieve(5, "(x&|y)", 1f, 0.81f, 1);
    t.mustBelieve(5, "(x=|>y)", 1f, 0.45f, 1);
    t.test(true);
// assertEquals( $.$("((x) &| (y))"), n.term("((x) &&+1 (y))"));
// assertEquals( $.$("((x) &| (y))"), n.term("((x) &&-1 (y))"));
// assertEquals( "(&|,(x),(y),(z))", n.term("(((x) &&+1 (y)) &&+1 (z))").toString());
// assertEquals( $.$("((x) &&+6 (y))"), n.term("((x) &&+6 (y))"));
// assertEquals( $.$("((x) =|> (y))"), n.term("((x) ==>+1 (y))"));
// //        assertEquals( $.$("((x) <|> (y))"), n.term("((x) <=>+1 (y))"));
}
Also used : TestNAR(nars.test.TestNAR) TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test)

Example 85 with TestNAR

use of nars.test.TestNAR in project narchy by automenta.

the class ArithmeticTest method testCompleteAddInduction.

@Test
public void testCompleteAddInduction() throws Narsese.NarseseException {
    NAR n = NARS.tmp();
    new ArithmeticIntroduction(16, n);
    TestNAR t = new TestNAR(n);
    t.confTolerance(0.8f);
    t.log();
    // t.believe("(x:1,x:2)");
    // t.believe("(x:2,x:3)");
    // t.believe("(x:3,x:4)");
    // t.believe("(x:4,x:5)");
    // t.ask("(x:5,?1)");
    // t.mustBelieve(1000, "(x:5,x:6)", 1f, 0.81f);
    t.believe("(a,1)");
    t.believe("(a,2)");
    t.believe("(a,3)");
    t.believe("(a,4)");
    t.ask("(a,#x)");
    t.mustBelieve(1000, // "((a,add(#1,1))&&(#1<->4))",
    "((a,add($1,1))==>(#1<->4))", 1f, 0.81f);
    t.mustBelieve(1000, "(a,5)", 1f, 0.81f);
    t.test(true);
}
Also used : TestNAR(nars.test.TestNAR) NAR(nars.NAR) TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test)

Aggregations

TestNAR (nars.test.TestNAR)178 Test (org.junit.jupiter.api.Test)169 NALTest (nars.util.NALTest)162 NAL7Test (nars.nal.nal7.NAL7Test)18 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 Disabled (org.junit.jupiter.api.Disabled)5 NAR (nars.NAR)2 Concept (nars.concept.Concept)2 DoubleSummaryStatistics (java.util.DoubleSummaryStatistics)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 BiFunction (java.util.function.BiFunction)1 IntFunction (java.util.function.IntFunction)1 nars (nars)1 NARS (nars.NARS)1 TaskStatistics (nars.task.util.TaskStatistics)1 Term (nars.term.Term)1 DeductiveMeshTest (nars.test.DeductiveMeshTest)1 ETERNAL (nars.time.Tense.ETERNAL)1 NotNull (org.jetbrains.annotations.NotNull)1 Assertions.assertNotEquals (org.junit.jupiter.api.Assertions.assertNotEquals)1