-
Notifications
You must be signed in to change notification settings - Fork 11
/
load-opencog.scm
61 lines (51 loc) · 1.5 KB
/
load-opencog.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
(use-modules (opencog)
(opencog cogserver)
(opencog logger)
(opencog nlp)
(opencog nlp relex2logic)
(opencog openpsi)
(opencog attention)
(opencog eva-behavior)
(opencog ghost)
(opencog ghost procedures)
(opencog exec))
(define start-ecan-agents
(string-append "agents-start "
"opencog::AFImportanceDiffusionAgent "
"opencog::WAImportanceDiffusionAgent "
"opencog::WARentCollectionAgent "
"opencog::AFRentCollectionAgent"))
(load "load-actions.scm")
(set-relex-server-host)
(start-cogserver "opencog.conf")
(cog-logger-set-stdout! #f)
; load and start the ghost-bridge-action-node
(use-modules (opencog ghost-bridge-action-node))
(start-ghost-bridge-action-node)
(define (ghost-set-ecan-filter . add-types)
(apply ecan-set-spreading-filter
(filter (lambda (x) (not (member x add-types))) (cog-get-types)))
)
(define (ec)
(ghost-set-ecan-filter
'ImplicationLink
'WordNode
'ConceptNode
'PredicateNode
'EvaluationLink
'GroundedPredicateNode)
)
; Handle command-line arguments
(when (and (equal? 2 (length (command-line)))
(equal? "enable-ecan" (cadr (command-line))))
; apply ECAN filter
(ec)
; start the ECAN agents
(system (string-append "echo \"" start-ecan-agents
"\" | nc localhost 17001"))
)
; start recording perception inputs after a delay of few seconds.
(sleep 5)
(perception-start!)
; Start the ghost loop
(ghost-run)