Search in sources :

Example 1 with AdjGraph

use of jcog.data.graph.AdjGraph in project narchy by automenta.

the class QuerySpider method starting.

@Override
protected void starting(NAR nar) {
    nar.onTask(t -> {
        if (t.isQuestOrQuestion() && t.term().hasVarQuery()) {
            Term tt = t.term();
            AdjGraph<Term, Float> g = spider(nar, t, 3);
            g.nodes.keysView().takeWhile(r -> {
                new UnifySubst(null, nar, (z) -> {
                    // TODO
                    return true;
                }, Param.TTL_MIN()).unify(tt, r.v, true);
                return true;
            });
        }
    });
}
Also used : AdjGraph(jcog.data.graph.AdjGraph) Param(nars.Param) TermGraph(nars.util.graph.TermGraph) UnifySubst(nars.term.subst.UnifySubst) Bag(jcog.bag.Bag) NAR(nars.NAR) Termed(nars.term.Termed) PriReference(jcog.pri.PriReference) Concept(nars.concept.Concept) NARService(nars.control.NARService) Term(nars.term.Term) Term(nars.term.Term) UnifySubst(nars.term.subst.UnifySubst)

Aggregations

Bag (jcog.bag.Bag)1 AdjGraph (jcog.data.graph.AdjGraph)1 PriReference (jcog.pri.PriReference)1 NAR (nars.NAR)1 Param (nars.Param)1 Concept (nars.concept.Concept)1 NARService (nars.control.NARService)1 Term (nars.term.Term)1 Termed (nars.term.Termed)1 UnifySubst (nars.term.subst.UnifySubst)1 TermGraph (nars.util.graph.TermGraph)1