OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / 2f9c528

Straighten out the demo some more
2f9c5287e8572be219d591874821b22ed8fd2387
by Linas Vepštas <linasvepstas@gmail.com> · 2024-04-05T04:11:48.000Z

Changed files (1) +21 -7

scm/pair-agent/count-agent.scm +21 -7
……@@ -24,7 +24,10 @@
2424; list of Edges.
2525;
2626(define (obs-txt PLAIN-TEXT)
27 (define parses (cog-execute!
27
28 (define parser
29 (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML)))
30 (define filt
2831 (Filter
2932 (Lambda
3033 (Variable "$x")
……@@ -32,7 +35,9 @@
3235 (Type 'LinkValue)
3336 (Type 'LinkValue)
3437 (Variable "$x")))
35 (PureExecLink (LgParseBonds (Phrase PLAIN-TEXT) DICT NUML)))))
38 parser))
39
40 (define parses (cog-execute! filt))
3641 parses
3742)
3843
……@@ -40,11 +45,20 @@
4045; How? Need:
4146; 3) ConcatenateLink like AccumulateLink, but flattens
4247; Is this needed?
43; 4) IncrementLinks link cog-inc-value!
44; 5) ForkStream to create two streams (so that each can get a
45; distinct filter.)
46; 5a) Alternately, support RuleLink so that multiple targets are allowed.
47; Then, ForkStream is a special case of Rule.
48; 4) IncrementLink just like cog-inc-value!
49; 5) Support RuleLink so that sttream forking can be done with
50; multiple targets in the rule.
51
52; Works but non-atomic.
53; Also requires RuleLink to work
54(define ed (Edge (Bond "ANY") (List (Word "words") (Word "know"))))
55(define (doinc)
56 (cog-execute!
57 (SetValue ed (Predicate "count")
58 (Plus (Number 0 0 1)
59 (Cond (FloatValueOf ed (Predicate "count"))
60 (FloatValueOf ed (Predicate "count"))
61 (FloatValueOf (Number 0 0 0)))))))
4862
4963
5064; (load "count-agent.scm")