networks: Rename and generalize state graph functions.
build-full-state-graph and build-full-state-graph-annotated now retrieve the domains from the network and are not limited to Boolean state graphs.
This commit is contained in:
parent
34ceccc446
commit
a074258b1a
1 changed files with 14 additions and 8 deletions
22
networks.rkt
22
networks.rkt
|
@ -66,8 +66,8 @@
|
||||||
[ppsg (-> graph? graph?)]
|
[ppsg (-> graph? graph?)]
|
||||||
[pretty-print-boolean-state-graph (-> graph? graph?)]
|
[pretty-print-boolean-state-graph (-> graph? graph?)]
|
||||||
[ppsgb (-> graph? graph?)]
|
[ppsgb (-> graph? graph?)]
|
||||||
[build-full-boolean-state-graph (-> dynamics? graph?)]
|
[build-full-state-graph (-> dynamics? graph?)]
|
||||||
[build-full-boolean-state-graph-annotated (-> dynamics? graph?)]
|
[build-full-state-graph-annotated (-> dynamics? graph?)]
|
||||||
[build-full-01-state-graph (-> dynamics? graph?)]
|
[build-full-01-state-graph (-> dynamics? graph?)]
|
||||||
[build-full-01-state-graph-annotated (-> dynamics? graph?)]
|
[build-full-01-state-graph-annotated (-> dynamics? graph?)]
|
||||||
[tabulate-state (->* (procedure? domain-mapping/c) (#:headers boolean?)
|
[tabulate-state (->* (procedure? domain-mapping/c) (#:headers boolean?)
|
||||||
|
@ -738,16 +738,22 @@
|
||||||
(define ppsgb pretty-print-boolean-state-graph)
|
(define ppsgb pretty-print-boolean-state-graph)
|
||||||
|
|
||||||
;;; Builds the full state graph of a Boolean network.
|
;;; Builds the full state graph of a Boolean network.
|
||||||
(define (build-full-boolean-state-graph dyn)
|
(define (build-full-state-graph dyn)
|
||||||
(dds-build-state-graph
|
(dds-build-state-graph
|
||||||
dyn
|
dyn
|
||||||
(list->set (build-all-boolean-states (hash-keys (dynamics-network dyn))))))
|
((compose list->set
|
||||||
|
build-all-states
|
||||||
|
network-domains
|
||||||
|
dynamics-network) dyn)))
|
||||||
|
|
||||||
;;; Build the full annotated state graph of a Boolean network.
|
;;; Build the full annotated state graph of a Boolean network.
|
||||||
(define (build-full-boolean-state-graph-annotated dyn)
|
(define (build-full-state-graph-annotated dyn)
|
||||||
(dds-build-state-graph-annotated
|
(dds-build-state-graph-annotated
|
||||||
dyn
|
dyn
|
||||||
(list->set (build-all-boolean-states (hash-keys (dynamics-network dyn))))))
|
((compose list->set
|
||||||
|
build-all-states
|
||||||
|
network-domains
|
||||||
|
dynamics-network) dyn)))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "Dynamics of networks"
|
(test-case "Dynamics of networks"
|
||||||
|
@ -761,8 +767,8 @@
|
||||||
(define gr-full (dds-build-state-graph asyn (set s)))
|
(define gr-full (dds-build-state-graph asyn (set s)))
|
||||||
(define gr-full-pp (pretty-print-state-graph gr-full))
|
(define gr-full-pp (pretty-print-state-graph gr-full))
|
||||||
(define gr-full-ppb (pretty-print-boolean-state-graph gr-full))
|
(define gr-full-ppb (pretty-print-boolean-state-graph gr-full))
|
||||||
(define gr-complete-bool (build-full-boolean-state-graph asyn))
|
(define gr-complete-bool (build-full-state-graph asyn))
|
||||||
(define gr-complete-bool-ann (build-full-boolean-state-graph-annotated asyn))
|
(define gr-complete-bool-ann (build-full-state-graph-annotated asyn))
|
||||||
(check-equal? (dds-step-one asyn s) (set (make-state '((a . #f) (b . #f)))
|
(check-equal? (dds-step-one asyn s) (set (make-state '((a . #f) (b . #f)))
|
||||||
(make-state '((a . #t) (b . #f)))))
|
(make-state '((a . #t) (b . #f)))))
|
||||||
(check-equal? (dds-step-one-annotated asyn s)
|
(check-equal? (dds-step-one-annotated asyn s)
|
||||||
|
|
Loading…
Reference in a new issue