Search in sources :

Example 1 with Bitmap2DSensor

use of nars.util.signal.Bitmap2DSensor in project narchy by automenta.

the class AutoConceptualizerTest method test1.

@Test
public void test1() {
    int W = 4, H = 4;
    NAR n = NARS.tmp();
    Bitmap2DSensor c = new Bitmap2DSensor((x, y) -> $.p(x, y), new Bitmap2D() {

        @Override
        public int width() {
            return W;
        }

        @Override
        public int height() {
            return H;
        }

        @Override
        public float brightness(int xx, int yy) {
            return (((xx + yy + n.time())) % 2) > 0 ? 1f : 0f;
        }
    }, n);
    AutoConceptualizer ac = new AutoConceptualizer(c.iter.order, /* HACK */
    true, 2, n);
    for (int i = 0; i < 155; i++) {
        c.input();
        c.print(System.out);
        n.run(1);
        System.out.println();
    }
}
Also used : Bitmap2D(jcog.signal.Bitmap2D) Bitmap2DSensor(nars.util.signal.Bitmap2DSensor) NAR(nars.NAR) Test(org.junit.jupiter.api.Test)

Aggregations

Bitmap2D (jcog.signal.Bitmap2D)1 NAR (nars.NAR)1 Bitmap2DSensor (nars.util.signal.Bitmap2DSensor)1 Test (org.junit.jupiter.api.Test)1