networks: state/tbf → tbf/state.

This commit is contained in:
Sergiu Ivanov 2020-07-23 00:11:14 +02:00
parent c27b9fe28b
commit a4be7922d4

View File

@ -15,7 +15,7 @@
(provide (provide
;; Structures ;; Structures
(struct-out dynamics) (struct-out dynamics)
(contract-out [struct state/tbf ([weights (hash/c variable? number?)] (contract-out [struct tbf/state ([weights (hash/c variable? number?)]
[threshold number?])]) [threshold number?])])
;; Functions ;; Functions
(contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)] (contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)]
@ -79,8 +79,8 @@
[random-network (domain-mapping/c . -> . network?)] [random-network (domain-mapping/c . -> . network?)]
[random-boolean-network ((listof variable?) . -> . network?)] [random-boolean-network ((listof variable?) . -> . network?)]
[random-boolean-network/vars (number? . -> . network?)] [random-boolean-network/vars (number? . -> . network?)]
[state/tbf-w (-> state/tbf? (hash/c variable? number?))] [tbf/state-w (-> tbf/state? (hash/c variable? number?))]
[state/tbf(-> state/tbf? number?)] [tbf/state-θ (-> tbf/state? number?)]
[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?)]
@ -944,11 +944,11 @@
;;; A state TBF is a TBF with named inputs. A state TBF can be ;;; A state TBF is a TBF with named inputs. A state TBF can be
;;; applied to states in an unambiguous ways. ;;; applied to states in an unambiguous ways.
(struct state/tbf (weights threshold)) (struct tbf/state (weights threshold))
;;; Shortcuts for acessing fields of a state/tbf. ;;; Shortcuts for acessing fields of a state/tbf.
(define state/tbf-w state/tbf-weights) (define tbf/state-w tbf/state-weights)
(define state/tbfstate/tbf-threshold) (define tbf/state-θ tbf/state-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?))