From a4be7922d436bcfcd1e00c03d4d32f1ee67fee92 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Thu, 23 Jul 2020 00:11:14 +0200 Subject: [PATCH] =?UTF-8?q?networks:=20state/tbf=20=E2=86=92=20tbf/state.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- networks.rkt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/networks.rkt b/networks.rkt index c1ae92a..5aa1bfc 100644 --- a/networks.rkt +++ b/networks.rkt @@ -15,7 +15,7 @@ (provide ;; Structures (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?])]) ;; Functions (contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)] @@ -79,8 +79,8 @@ [random-network (domain-mapping/c . -> . network?)] [random-boolean-network ((listof variable?) . -> . network?)] [random-boolean-network/vars (number? . -> . network?)] - [state/tbf-w (-> state/tbf? (hash/c variable? number?))] - [state/tbf-θ (-> state/tbf? number?)] + [tbf/state-w (-> tbf/state? (hash/c variable? number?))] + [tbf/state-θ (-> tbf/state? number?)] [apply-tbf-to-state (-> tbf? state? (or/c 0 1))]) ;; Predicates (contract-out [variable? (-> any/c boolean?)] @@ -944,11 +944,11 @@ ;;; A state TBF is a TBF with named inputs. A state TBF can be ;;; 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. -(define state/tbf-w state/tbf-weights) -(define state/tbf-θ state/tbf-threshold) +(define tbf/state-w tbf/state-weights) +(define tbf/state-θ tbf/state-threshold) ;;; A TBN is a network form mapping TBFs to variables. (define tbn? (hash/c variable? tbf?))