networks: Add make-tbf/state.
This commit is contained in:
parent
91c45ada06
commit
0b41cf54fc
1 changed files with 5 additions and 0 deletions
|
@ -81,6 +81,7 @@
|
||||||
[random-boolean-network/vars (number? . -> . network?)]
|
[random-boolean-network/vars (number? . -> . network?)]
|
||||||
[tbf/state-w (-> tbf/state? (hash/c variable? number?))]
|
[tbf/state-w (-> tbf/state? (hash/c variable? number?))]
|
||||||
[tbf/state-θ (-> tbf/state? number?)]
|
[tbf/state-θ (-> tbf/state? number?)]
|
||||||
|
[make-tbf/state (-> (listof (cons/c variable? number?)) number? tbf/state?)]
|
||||||
[apply-tbf-to-state (-> tbf? state? (or/c 0 1))])
|
[apply-tbf-to-state (-> tbf? state? (or/c 0 1))])
|
||||||
;; Predicates
|
;; Predicates
|
||||||
(contract-out [variable? (-> any/c boolean?)]
|
(contract-out [variable? (-> any/c boolean?)]
|
||||||
|
@ -950,5 +951,9 @@
|
||||||
(define tbf/state-w tbf/state-weights)
|
(define tbf/state-w tbf/state-weights)
|
||||||
(define tbf/state-θ tbf/state-threshold)
|
(define tbf/state-θ tbf/state-threshold)
|
||||||
|
|
||||||
|
;;; Makes a state/tbf from a list of pairs of names of variables and
|
||||||
|
;;; weights, as well as a threshold.
|
||||||
|
(define (make-tbf/state pairs threshold)
|
||||||
|
(tbf/state (make-immutable-hash pairs) threshold))
|
||||||
;;; 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