networks: Add some tests for tbf/state.

This commit is contained in:
Sergiu Ivanov 2020-07-23 00:20:00 +02:00
parent 0b41cf54fc
commit e370356fac

View file

@ -955,5 +955,12 @@
;;; weights, as well as a threshold.
(define (make-tbf/state pairs threshold)
(tbf/state (make-immutable-hash pairs) threshold))
(module+ test
(test-case "tbf/state"
(define f (make-tbf/state '((x1 . 1) (x2 . 1)) 1))
(check-equal? (tbf/state-w f) #hash((x1 . 1) (x2 . 1)))
(check-equal? (tbf/state-θ f) 1)))
;;; A TBN is a network form mapping TBFs to variables.
(define tbn? (hash/c variable? tbf?))