Search in sources :

Example 1 with Splitting

use of spacegraph.space2d.container.Splitting in project narchy by automenta.

the class ExeCharts method metaGoalPlot.

public static Surface metaGoalPlot(NAR nar) {
    int s = nar.causes.size();
    FloatRange gain = new FloatRange(20f, 0f, 20f);
    BitmapMatrixView bmp = new BitmapMatrixView((i) -> Util.tanhFast(gain.floatValue() * nar.causes.get(i).value()), // Util.tanhFast(nar.causes.get(i).value()),
    s, Math.max(1, (int) Math.ceil(Math.sqrt(s))), Draw::colorBipolar) {

        DurService on;

        {
            on = DurService.on(nar, this::update);
        }

        @Override
        public void stop() {
            on.off();
            on = null;
            super.stop();
        }
    };
    return new Splitting(bmp, new AutoSurface<>(gain), 0.1f);
}
Also used : BitmapMatrixView(spacegraph.space2d.widget.meter.BitmapMatrixView) Splitting(spacegraph.space2d.container.Splitting) Draw(spacegraph.video.Draw) FloatRange(jcog.math.FloatRange) DurService(nars.control.DurService)

Aggregations

FloatRange (jcog.math.FloatRange)1 DurService (nars.control.DurService)1 Splitting (spacegraph.space2d.container.Splitting)1 BitmapMatrixView (spacegraph.space2d.widget.meter.BitmapMatrixView)1 Draw (spacegraph.video.Draw)1