Search in sources :

Example 51 with TestNAR

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

the class NAL2Test method set_operations2_difference.

@Test
public void set_operations2_difference() throws Narsese.NarseseException {
    assertEquals("{Mars,Venus}", DIFFe.the($.$("{Mars,Pluto,Venus}"), $.$("{Pluto,Saturn}")).toString());
    TestNAR tester = test;
    // .en("PlanetX is Mars, Pluto, or Venus.");
    tester.believe("(planetX --> {Mars,Pluto,Venus})", 0.9f, 0.9f);
    // .en("PlanetX is probably neither Pluto nor Saturn.");
    tester.believe("(planetX --> {Pluto,Saturn})", 0.1f, 0.9f);
    // .en("PlanetX is either Mars or Venus.");
    tester.mustBelieve(cycles * 2, "(planetX --> {Mars,Venus})", 0.9f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 52 with TestNAR

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

the class NAL2Test method set_operations5.

@Test
public void set_operations5() {
    TestNAR tester = test;
    // .en("PlanetX is Mars, Pluto, or Venus.");
    tester.believe("<{Mars,Pluto,Venus} --> planetX>", 1.0f, 0.9f);
    // .en("PlanetX is probably neither Pluto nor Saturn.");
    tester.believe("<{Pluto,Saturn} --> planetX>", 0.1f, 0.9f);
    // .en("PlanetX is Mars, Pluto, Saturn, or Venus.");
    tester.mustBelieve(cycles * 3, "<{Mars,Pluto,Saturn,Venus} --> planetX>", 0.1f, 0.81f);
    // .en("PlanetX is either Mars or Venus.");
    tester.mustBelieve(cycles * 3, "<{Mars,Venus} --> planetX>", 0.9f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 53 with TestNAR

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

the class NAL2Test method setDefinition4.

@Test
public void setDefinition4() {
    TestNAR tester = test;
    // Bright thing is similar to smart thing.");
    tester.believe("<[bright] <-> [smart]>");
    // Bright is similar to smart.");
    tester.mustBelieve(cycles, "<bright <-> smart>", 1.0f, 0.9f);
    // Bright thing is a type of smart thing.");
    tester.mustBelieve(cycles, "<[bright] --> [smart]>", 1.0f, 0.9f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 54 with TestNAR

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

the class NAL2Test method inheritanceToSimilarity2.

@Test
public void inheritanceToSimilarity2() {
    TestNAR tester = test;
    // Swan is a type of bird.");
    tester.believe("<swan --> bird>");
    // Bird is different from swan.");
    tester.believe("<bird <-> swan>", 0.1f, 0.9f);
    // Bird is probably not a type of swan.");
    tester.mustBelieve(cycles * 4, "<bird --> swan>", 0.1f, 0.73f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

Example 55 with TestNAR

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

the class NAL2Test method set_operationsSetExt_unionNeg.

@Test
public void set_operationsSetExt_unionNeg() {
    TestNAR tester = test;
    // .en("PlanetX is Mars, Pluto, or Venus.");
    tester.believe("<planetX --> {Earth}>", 0.1f, 0.9f);
    // .en("PlanetX is probably neither Pluto nor Saturn.");
    tester.believe("<planetX --> {Mars}>", 0.1f, 0.9f);
    // .en("PlanetX is Mars, Pluto, Saturn, or Venus.");
    tester.mustBelieve(cycles, "<planetX --> {Earth,Mars}>", 0.19f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest)

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