networks: Add make-boolean-network-form.
This commit is contained in:
parent
d5e1819fff
commit
a4979d9c9f
1 changed files with 11 additions and 0 deletions
11
networks.rkt
11
networks.rkt
|
@ -31,6 +31,7 @@
|
||||||
[booleanize-state (-> state? state?)]
|
[booleanize-state (-> state? state?)]
|
||||||
[update-function-form->update-function (-> update-function-form? update-function/c)]
|
[update-function-form->update-function (-> update-function-form? update-function/c)]
|
||||||
[network-form->network (-> network-form? network?)]
|
[network-form->network (-> network-form? network?)]
|
||||||
|
[make-boolean-network-form (-> variable-mapping? network-form?)]
|
||||||
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
||||||
[build-syntactic-interaction-graph (-> network-form? graph?)]
|
[build-syntactic-interaction-graph (-> network-form? graph?)]
|
||||||
[interaction? (-> network? variable? variable? boolean?)]
|
[interaction? (-> network? variable? variable? boolean?)]
|
||||||
|
@ -288,6 +289,16 @@
|
||||||
(define s (make-state '((a . #t) (b . #t))))
|
(define s (make-state '((a . #t) (b . #t))))
|
||||||
(check-equal? ((hash-ref (network-functions bn) 'a) s) #t)))
|
(check-equal? ((hash-ref (network-functions bn) 'a) s) #t)))
|
||||||
|
|
||||||
|
;;; Build a Boolean network form from a given mapping assigning forms
|
||||||
|
;;; to variables.
|
||||||
|
(define (make-boolean-network-form forms)
|
||||||
|
(network-form forms (make-boolean-domains (hash-keys forms))))
|
||||||
|
|
||||||
|
(module+ test
|
||||||
|
(test-case "make-boolean-network-form"
|
||||||
|
(make-boolean-network-form (hash 'a '(and a b)
|
||||||
|
'b '(not b)))))
|
||||||
|
|
||||||
|
|
||||||
;;; ============================
|
;;; ============================
|
||||||
;;; Inferring interaction graphs
|
;;; Inferring interaction graphs
|
||||||
|
|
Loading…
Reference in a new issue