Search in sources :

Example 16 with Disabled

use of org.junit.jupiter.api.Disabled in project narchy by automenta.

the class NAL5Test method compound_composition_one_premises.

/**
 * not sure this one makes logical sense
 */
@Disabled
@Test
public void compound_composition_one_premises() throws nars.Narsese.NarseseException {
    TestNAR tester = test;
    // .en("Robin can fly.");
    tester.believe("<robin --> [flying]>");
    // .en("Can robin fly or swim?");
    tester.ask("(||,<robin --> [flying]>,<robin --> swimmer>)");
    // tester.mustBelieve(cycles*2," (||,<robin --> swimmer>,<robin --> [flying]>)",1.00f,0.81f); //.en("Robin can fly or swim.");
    // .en("Robin can fly or swim.");
    tester.mustBelieve(cycles * 2, " (&&,(--,<robin --> swimmer>),(--,<robin --> [flying]>))", 0.00f, 0.81f);
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest) Disabled(org.junit.jupiter.api.Disabled)

Example 17 with Disabled

use of org.junit.jupiter.api.Disabled in project narchy by automenta.

the class NAL6Test method variable_introduction3.

@Test
@Disabled
public void variable_introduction3() {
    TestNAR tester = test;
    // en("A gull is a swimmer.");
    tester.believe("<gull --> swimmer>", 1f, 0.9f);
    // en("A swan is never a swimmer.");
    tester.believe("<swan --> swimmer>", 0f, 0.9f);
    // en("Gull and swan have no commonality.");
    tester.mustBelieve(cycles, "(&&,<gull --> #1>,<swan --> #1>)", 0.0f, 0.81f);
    // en("Gull and non-swans have commonality.");
    tester.mustBelieve(cycles, "(&&,<gull --> #1>,(--,<swan --> #1>))", 1.0f, 0.81f);
// tester.mustBelieve(cycles, "<<gull --> $1> ==> <swan --> $1>>", 0.80f, 0.45f); //en("I guess what can be said about gull usually can also be said about swan.");
// tester.mustBelieve(cycles, "<<swan --> $1> ==> <gull --> $1>>", 1.00f, 0.39f); //en("I guess what can be said about swan can also be said about gull.");
// tester.mustBelieve(cycles, "<<gull --> $1> <=> <swan --> $1>>", 0.80f, 0.45f); //en("I guess gull and swan share most properties.");
}
Also used : TestNAR(nars.test.TestNAR) Test(org.junit.jupiter.api.Test) NALTest(nars.util.NALTest) Disabled(org.junit.jupiter.api.Disabled)

Example 18 with Disabled

use of org.junit.jupiter.api.Disabled in project narchy by automenta.

the class PtrManTests method testOps1.

@Disabled
@Test
public void testOps1() throws Narsese.NarseseException {
    NAR n = NARS.tmp();
    n.input("opProximity2(OPmov(0,5),OPsub(0,5)).", "opProximity2(OPmov(1,5),OPsub(1,4)).", "opProximity2(OPmov(1,5),OPsub(1,7)).", "( opProximity3((($op1, $op2)-->$1), (($op3, $op4)-->$2), ((#op5, #op6)-->#3) ) =|> opProximity2( (($op1, $op2)-->$1), (($op3, $op4)-->$2) ).", "( opProximity3(#1, #op1, #op2, $2, $op3, $op4, $3, $op5, $op6) =|> opProximity2($2, $op3, $op4, $3, $op5, $op6) ).", "opProximity3(OPmov, {0}, {5}, OPsub, {0}, {5}, OPsub, {1}, {7}).", "opProximity3(OPsub, {1}, {7}, OPmul, {0}, {5}, OPmul, {0}, {5}).", "opProximity3(OPsub, {1}, {7}, OPdiv, {0}, {7}, OPmul, {0}, {5}).", "(OPcmp <-> OPadd). %0.55;0.9%", "(OPsub <-> OPadd). %0.7;0.9%", "(OPadd <-> OPmuladd). %0.6;0.9%", "(OPmov <-> OPxchg). %0.8;0.9%", "$1.0 ((OPxchg, {0}, {5}, OPsub, {0}, {5}) <-> (OPmov, {0}, {5}, OPadd, {0}, {5}))?", "$1.0 opProximity2(OPadd, {0}, {5}, OPsub, {1}, {7})?");
    Param.DEBUG = true;
    // n.logBudgetMin(System.out, 0.25f);
    n.run(1000);
}
Also used : NAR(nars.NAR) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 19 with Disabled

use of org.junit.jupiter.api.Disabled in project narchy by automenta.

the class DigitizedScalarTest method testRewardConceptsFuzzification3.

// @Test
// public void testRewardConceptsFuzzification1() {
// NAR d = new Default();
// MutableFloat m = new MutableFloat(0f);
// 
// testSteadyFreqCondition(m,
// new FuzzyScalarConcepts(
// new FloatNormalized(() -> m.floatValue()).updateRange(-1).updateRange(1),
// d, FuzzyScalarConcepts.FuzzyTriangle, $.p("x")),
// (f) -> Util.equals(f, 0.5f + 0.5f * m.floatValue(), tolerance)
// );
// }
@Disabled
@Test
public void testRewardConceptsFuzzification3() {
    NAR n = NARS.shell();
    MutableFloat m = new MutableFloat(0f);
    FloatNormalized range = new FloatPolarNormalized(() -> m.floatValue(), 1f);
    DigitizedScalar f = new DigitizedScalar(range, DigitizedScalar.FuzzyNeedle, n, $.p("low"), $.p("mid"), $.p("hih"));
    // {
    // f.clear();
    // m.setValue(0); d.next();
    // System.out.println(Texts.n4(m.floatValue()) + "\t" + f.toString());
    // assertEquals("(I-->[sad]) %0.25;.90%\t(I-->[neutral]) %1.0;.90%\t(I-->[happy]) %0.0;.90%", f.toString());
    // }
    // 
    // {
    // f.clear();
    // m.setValue(-1); d.next();
    // System.out.println(Texts.n4(m.floatValue()) + "\t" + f.toString());
    // assertEquals("(I-->[sad]) %1.0;.90%\t(I-->[neutral]) %0.0;.90%\t(I-->[happy]) %0.0;.90%", f.toString());
    // }
    // 
    // {
    // f.clear();
    // m.setValue(+1); d.next();
    // System.out.println(Texts.n4(m.floatValue()) + "\t" + f.toString());
    // assertEquals("(I-->[sad]) %0.0;.90%\t(I-->[neutral]) %0.0;.90%\t(I-->[happy]) %1.0;.90%", f.toString());
    // }
    testSteadyFreqCondition(m, f, (freqSum) -> {
        System.out.println(freqSum + " " + tolerance);
        return Util.equals(freqSum, 1f, tolerance);
    }, n);
}
Also used : FloatNormalized(jcog.math.FloatNormalized) MutableFloat(org.apache.commons.lang3.mutable.MutableFloat) DigitizedScalar(nars.concept.scalar.DigitizedScalar) FloatPolarNormalized(jcog.math.FloatPolarNormalized) NAR(nars.NAR) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 20 with Disabled

use of org.junit.jupiter.api.Disabled in project narchy by automenta.

the class OpjectsTest method learnMethodGoal.

@Disabled
@Test
public void learnMethodGoal() throws Narsese.NarseseException {
    // StringBuilder sb = new StringBuilder();
    // n.onTask(sb::append);
    Param.DEBUG = true;
    final NAR n = NARS.tmp();
    final Opjects objs = new Opjects(n);
    final SimpleClass x = objs.a("x", SimpleClass.class);
    n.beliefPriDefault.set(0.05f);
    n.questionPriDefault.set(0.05f);
    n.questPriDefault.set(0.05f);
    n.freqResolution.set(0.1f);
    n.time.dur(10);
    n.termVolumeMax.set(30);
    n.logPriMin(System.out, 0.02f);
    // n.onTask(xx -> {
    // if (xx instanceof DerivedTask) {
    // if (xx.isGoal())
    // System.out.println(xx);
    // }
    // });
    int N = 2;
    n.clear();
    int loops = 0, trainingRounds = 4;
    while (x.v != 2) {
        if (loops++ < trainingRounds) {
            for (int i = 0; i < 2; i++) {
                x.set(i % N);
                n.run(1);
                x.get();
                n.run(1);
            }
            // n.input("$0.5 (0<->2)?");
            // n.input("$0.5 (1<->2)?");
            n.input("$1.0 x(get,(),2)!");
            n.run(50);
        }
        // n.input("$1.0 x(set,2)! :|:");
        // n.input("$1.0 SimpleClass(get,x,(),2)! :|:");
        // n.input("$1.0 SimpleClass(get,x,(),_)! :|:");
        // n.input("$1.0 --SimpleClass(get,x,(),0)! :|:");
        // n.input("$1.0 --SimpleClass(get,x,(),1)! :|:");
        n.run(50);
    }
// while (x.v!=3) {
// 
// }
// n.input("$0.5 (0<->1)?");
// n.input("$0.5 (1<->2)?");
// n.input("$0.5 (2<->3)?");
// n.input("$0.5 (3<->4)?");
// n.input("$1.0 (SimpleClass(set,x,$x) ==> SimpleClass(get,x,(),$x))?");
// n.run(100);
// n.tasks().forEachOrdered(z -> {
// System.out.println(z);
// });
}
Also used : NAR(nars.NAR) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)358 Test (org.junit.jupiter.api.Test)343 URL (java.net.URL)67 ArrayList (java.util.ArrayList)23 File (java.io.File)20 List (java.util.List)15 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 CountDownLatch (java.util.concurrent.CountDownLatch)11 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 Path (java.nio.file.Path)10 HashMap (java.util.HashMap)10 IOException (java.io.IOException)9 NAR (nars.NAR)9 BaseDataTest (org.apache.ibatis.BaseDataTest)8 Timeout (org.junit.jupiter.api.Timeout)8 Arrays (java.util.Arrays)7 ExecutorService (java.util.concurrent.ExecutorService)7 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7