networks: Add some tests for tbf/state.
This commit is contained in:
parent
0b41cf54fc
commit
e370356fac
1 changed files with 7 additions and 0 deletions
|
@ -955,5 +955,12 @@
|
||||||
;;; weights, as well as a threshold.
|
;;; weights, as well as a threshold.
|
||||||
(define (make-tbf/state pairs threshold)
|
(define (make-tbf/state pairs threshold)
|
||||||
(tbf/state (make-immutable-hash 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.
|
;;; A TBN is a network form mapping TBFs to variables.
|
||||||
(define tbn? (hash/c variable? tbf?))
|
(define tbn? (hash/c variable? tbf?))
|
||||||
|
|
Loading…
Reference in a new issue