OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / 47a4910

Use just one Trigger, not four
47a491018005fdd860f9c6d7aa5d79edab035f8c
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-23T05:57:30.000Z

Changed files (1) +9 -8

examples/flow/flow-futures.scm +9 -8
……@@ -28,15 +28,16 @@
2828(define cvp (PredicateNode "*-CountingKey-*"))
2929(define one (NumberNode 0 0 1))
3030
31; The TriggerLink will execute, in sequential order, whatever it wraps.
32; It will return the result of the last thing that was executed; here,
33; the total count, providing visual confirmation that it's working.
3134(define (incr-counts THING-A THING-B)
32 (Trigger (IncrementValue
33 (List THING-A THING-B) cvp one))
34 (Trigger (IncrementValue
35 (List (AnyNode "left wildcard") THING-B) cvp one))
36 (Trigger (IncrementValue
37 (List THING-A (AnyNode "right wildcard")) cvp one))
38 (Trigger (IncrementValue
39 (List (Any "left wildcard") (Any "right wildcard")) cvp one)))
35 (Trigger
36 (IncrementValue (List THING-A THING-B) cvp one)
37 (IncrementValue (List (AnyNode "left wildcard") THING-B) cvp one)
38 (IncrementValue (List THING-A (AnyNode "right wildcard")) cvp one)
39 (IncrementValue
40 (List (Any "left wildcard") (Any "right wildcard")) cvp one)))
4041
4142; Same as above, but works with strings. It counts how often a pair
4243; was "observed".