From 3fa5b7ca89572a7749ac62e10c325a02c5de728b Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Thu, 23 Jul 2020 00:05:34 +0200 Subject: [PATCH] =?UTF-8?q?networks:=20Add=20state/tbf-w=20and=20state/tbf?= =?UTF-8?q?-=CE=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- networks.rkt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/networks.rkt b/networks.rkt index b6dbd55..d0b7814 100644 --- a/networks.rkt +++ b/networks.rkt @@ -79,6 +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?)] [apply-tbf-to-state (-> tbf? state? (or/c 0 1))]) ;; Predicates (contract-out [variable? (-> any/c boolean?)] @@ -931,6 +933,10 @@ ;;; applied to states in an unambiguous ways. (struct state/tbf (weights threshold)) +;;; Shortcuts for acessing fields of a state/tbf. +(define state/tbf-w state/tbf-weights) +(define state/tbf-θ state/tbf-threshold) + ;;; A TBN is a network form mapping TBFs to variables. (define tbn? (hash/c variable? tbf?))