Search in sources :

Example 1 with Ons

use of jcog.event.Ons in project narchy by automenta.

the class AutoSurface method start.

@Override
public void start(@Nullable SurfaceBase parent) {
    synchronized (this) {
        seen.clear();
        ons = new Ons();
        List<Surface> l = new FasterList();
        collect(obj, l, 0);
        super.start(parent);
        set(l);
    }
}
Also used : Ons(jcog.event.Ons) FasterList(jcog.list.FasterList) Surface(spacegraph.space2d.Surface)

Example 2 with Ons

use of jcog.event.Ons in project narchy by automenta.

the class NARService method start.

@Override
protected final void start(NAR nar) {
    synchronized (this) {
        logger.debug("start {}", id);
        this.nar = nar;
        ons = new Ons(nar.eventClear.on(n -> clear()));
        starting(nar);
    }
}
Also used : Ons(jcog.event.Ons)

Example 3 with Ons

use of jcog.event.Ons in project narchy by automenta.

the class DynamicConceptSpace method start.

@Override
public void start(SpaceGraphPhys3D<Concept> space) {
    synchronized (this) {
        super.start(space);
        onDur = DurService.on(nar, () -> {
            if (!updated.get() && concepts.update()) {
                updated.set(true);
            }
        }).durs(1);
        this.onClear = new Ons(nar.eventClear.on(() -> {
            synchronized (this) {
                next.write().clear();
                next.commit();
                concepts.clear();
            }
        }));
    }
}
Also used : Ons(jcog.event.Ons)

Aggregations

Ons (jcog.event.Ons)3 FasterList (jcog.list.FasterList)1 Surface (spacegraph.space2d.Surface)1