networks: Add build-full-01-state-graph and build-full-01-state-graph-annotated.

This commit is contained in:
Sergiu Ivanov 2020-10-18 22:57:08 +02:00
parent afa84d00b5
commit b3d2ed94ec

View file

@ -63,6 +63,8 @@
[ppsgb (-> graph? graph?)] [ppsgb (-> graph? graph?)]
[build-full-boolean-state-graph (-> dynamics? graph?)] [build-full-boolean-state-graph (-> dynamics? graph?)]
[build-full-boolean-state-graph-annotated (-> dynamics? graph?)] [build-full-boolean-state-graph-annotated (-> dynamics? graph?)]
[build-full-01-state-graph (-> 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?)
(listof (listof any/c)))] (listof (listof any/c)))]
[tabulate-state* (->* ((non-empty-listof procedure?) domain-mapping/c) (#:headers boolean?) [tabulate-state* (->* ((non-empty-listof procedure?) domain-mapping/c) (#:headers boolean?)
@ -760,6 +762,20 @@
#hash((a . #f) (b . #t)) #hash((a . #t) (b . #t))) #hash((a . #f) (b . #t)) #hash((a . #t) (b . #t)))
(set (set 'a))))) (set (set 'a)))))
;;; Like build-full-boolean-state-graph, but the states are expressed
;;; in 0 and 1, instead of #f and #t.
(define (build-full-01-state-graph dyn)
(dds-build-state-graph
dyn
(list->set (build-all-01-states (hash-keys (dynamics-network dyn))))))
;;; Like build-full-boolean-state-graph-annotated, but the states are expressed
;;; in 0 and 1, instead of #f and #t.
(define (build-full-01-state-graph-annotated dyn)
(dds-build-state-graph-annotated
dyn
(list->set (build-all-01-states (hash-keys (dynamics-network dyn))))))
;;; ================================= ;;; =================================
;;; Tabulating functions and networks ;;; Tabulating functions and networks