rs: Add pretty-print-state-graph.
This commit is contained in:
parent
a3967d8bf8
commit
f22d42f98c
1 changed files with 10 additions and 2 deletions
12
rs.rkt
12
rs.rkt
|
@ -26,13 +26,14 @@
|
|||
[dds-build-n-step-state-graph (-> dynamics? (set/c state? #:kind 'dont-care) number? graph?)]
|
||||
[dds-build-state-graph-annotated (-> dynamics? (set/c state? #:kind 'dont-care) graph?)]
|
||||
[dds-build-n-step-state-graph-annotated (-> dynamics? (set/c state? #:kind 'dont-care) number? graph?)]
|
||||
[build-interactive-process (-> reaction-system/c (listof (set/c species?)) graph?)])
|
||||
[build-interactive-process (-> reaction-system/c (listof (set/c species?)) graph?)]
|
||||
[pretty-print-state-graph (-> graph? graph?)])
|
||||
;; Predicates
|
||||
(contract-out [species? (-> any/c boolean?)])
|
||||
;; Contracts
|
||||
(contract-out [reaction-system/c contract?])
|
||||
;; Syntax
|
||||
unorg-rs org-rs read-ctx)
|
||||
unorg-rs org-rs read-ctx ppsg)
|
||||
|
||||
;;; =================
|
||||
;;; Basic definitions
|
||||
|
@ -171,3 +172,10 @@
|
|||
(define (build-interactive-process rs contexts)
|
||||
(dds-build-state-graph-annotated (dynamics rs)
|
||||
(set (state (set) contexts))))
|
||||
|
||||
;;; Pretty prints the state graph of a reaction system.
|
||||
(define (pretty-print-state-graph sgr)
|
||||
(update-graph sgr #:e-func pretty-print-set-sets))
|
||||
|
||||
;;; A shortcut for pretty-print-state-graph.
|
||||
(define-syntax-rule (ppsg sgr) (pretty-print-state-graph sgr))
|
||||
|
|
Loading…
Reference in a new issue