use of nars.test.TestNAR in project narchy by automenta.
the class LinkageTest method testConceptFormed.
public void testConceptFormed(@NotNull String s) throws Exception {
test.requireConditions = false;
TestNAR tester = test;
tester.believe(s, 1.0f, 0.9f);
tester.nar.run(10);
Concept ret = tester.nar.conceptualize(s);
assertNotNull(ret, "Failed to create a concept for " + s);
}
use of nars.test.TestNAR in project narchy by automenta.
the class PatrickTests method testToothbrushSimpler.
@Test
public void testToothbrushSimpler() {
TestNAR tt = test;
// Param.TRACE = true;
int cycles = 5000;
tt.confTolerance(0.9f);
// MetaGoal.Desire.want(nar.want, 0.5f);
tt.nar.freqResolution.set(0.05f);
tt.nar.confResolution.set(0.02f);
// tt.nar.DEFAULT_BELIEF_PRIORITY = 0.1f;
tt.nar.time.dur(10);
tt.nar.termVolumeMax.set(32);
// tt.nar.deep.set(0.75f);
// tt.log();
// tt.nar.emotion.deriveFailTemporal.why.on((x)->System.out.println(x));
tt.input("made_of(toothbrush,plastic).", "( ( made_of($1, plastic) &| lighter($1) ) ==>+10 hot:$1).", "(hot:$1 ==>+10 molten:$1).", "(molten:$1 =|> pliable:$1).", "(pliable:$1 =|> molten:$1).", "( (pliable:$1 &| reshape($1)) ==>+10 hard:$1).", "(hard:$1 =|> unscrews:$1).", "$1.0 unscrews:toothbrush! :|:");
tt.mustGoal(cycles, "hot:toothbrush", 1f, 0.5f, (t) -> t >= 0);
tt.mustGoal(cycles, "hard:toothbrush", 1f, 0.5f, (t) -> t >= 0);
tt.mustGoal(cycles, "pliable:toothbrush", 1f, 0.5f, (t) -> t >= 0);
tt.mustGoal(cycles, "molten:toothbrush", 1f, 0.5f, (t) -> t >= 0);
tt.mustGoal(cycles, "lighter(toothbrush)", 1f, 0.3f, (t) -> t == 0);
}
use of nars.test.TestNAR in project narchy by automenta.
the class OperatorTest method testIO.
static void testIO(String input, String output) {
TestNAR t = new TestNAR(NARS.tmp());
t.log();
t.mustOutput(16, output);
t.input(input);
t.test(4);
}
use of nars.test.TestNAR in project narchy by automenta.
the class bAblTests method test2.
@Test
public void test2() {
// (2) Factoid QA with Two Supporting Facts
// background knowledge (multiple input for priority boost to have the answer faster ^^)
// if something is picked, it means that the object which is picked is where the person is
TestNAR t = test;
t.nar.freqResolution.set(0.1f);
t.nar.termVolumeMax.set(24);
t.believe("((pick(#Person,$Object) &&+0 inside(#Person,$Place)) ==>+0 inside($Object,$Place))").input(// //John is in the playground.
"inside(john,playground). :|:").input(// //Bob is in the office.
"inside(bob,office). :|:").input(// //John picked up the football.
"pick(john,football). :|:").input(// //Bob went to the kitchen.
"inside(bob,kitchen). :|:").input(// //Where is the football?
"$0.9 inside(football,?where)?").input(// //Where is the football?
"$0.9 inside(football,?where)?").mustOutput(0, 1400, "inside(football,playground)", BELIEF, 1f, 1f, 0.5f, 0.99f, // //A: playground
0);
}
use of nars.test.TestNAR in project narchy by automenta.
the class NAL2Test method missingEdgeCase1.
@Test
public void missingEdgeCase1() {
// ((<%1 --> %2>, <%2 <-> %3>, not_equal(%3, %1)), (<%1 --> %3>, (<Analogy --> Truth>, <Strong --> Desire>, <AllowBackward --> Derive>)))
// ((<%1 --> %2>, <%2 <-> %3>, not_equal(%3, %1)),
// (<%1 --> %3>,
// ((<p1 --> p2>, <p2 <-> p3>, not_equal(p3, p1)),
// (<p1 --> p3>,
// TestNAR tester = test();
TestNAR tester = test;
tester.believe("<p1 --> p2>");
tester.believe("<p2 <-> p3>");
tester.mustBelieve(cycles, "<p1 --> p3>", 1.0f, 1.0f, 0.81f, 1.0f);
// tester.debug();
}
Aggregations