use of jcog.math.FloatPolarNormalized 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);
}
Aggregations