networks: Streamline print-org-tbfs/state.

This commit is contained in:
Sergiu Ivanov 2020-10-14 00:07:08 +02:00
parent 664aa89c6a
commit 2d1ef85209

View file

@ -1146,14 +1146,12 @@
;;; names of the variables, as well as the symbol 'θ to represent the
;;; column giving the thresholds of the TBF.
(define (print-org-tbfs/state tbfs #:headers [headers #t])
(define table (for/list ([tbf (in-list tbfs)])
(append (hash-map (tbf/state-w tbf) (λ (_ w) w) #t)
(list (tbf/state-θ tbf)))))
(append
(if headers
(list (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ)))
(empty))
(cons (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ))
table)
table))
(module+ test