networks: Streamline print-org-tbfs/state.
This commit is contained in:
parent
664aa89c6a
commit
2d1ef85209
1 changed files with 4 additions and 6 deletions
10
networks.rkt
10
networks.rkt
|
@ -1146,15 +1146,13 @@
|
||||||
;;; names of the variables, as well as the symbol 'θ to represent the
|
;;; names of the variables, as well as the symbol 'θ to represent the
|
||||||
;;; column giving the thresholds of the TBF.
|
;;; column giving the thresholds of the TBF.
|
||||||
(define (print-org-tbfs/state tbfs #:headers [headers #t])
|
(define (print-org-tbfs/state tbfs #:headers [headers #t])
|
||||||
|
|
||||||
(define table (for/list ([tbf (in-list tbfs)])
|
(define table (for/list ([tbf (in-list tbfs)])
|
||||||
(append (hash-map (tbf/state-w tbf) (λ (_ w) w) #t)
|
(append (hash-map (tbf/state-w tbf) (λ (_ w) w) #t)
|
||||||
(list (tbf/state-θ tbf)))))
|
(list (tbf/state-θ tbf)))))
|
||||||
(append
|
(if headers
|
||||||
(if headers
|
(cons (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ))
|
||||||
(list (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ)))
|
table)
|
||||||
(empty))
|
table))
|
||||||
table))
|
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "print-org-tbfs/state"
|
(test-case "print-org-tbfs/state"
|
||||||
|
|
Loading…
Reference in a new issue