rs: Add ReactionSystem.

This commit is contained in:
Sergiu Ivanov 2020-03-01 19:19:58 +01:00
parent f62592574b
commit 0cb57196c5

6
rs.rkt
View file

@ -8,7 +8,7 @@
;; Structures ;; Structures
reaction reaction
;; Type names ;; Type names
Species Species ReactionSystem
;; Functions ;; Functions
enabled?) enabled?)
@ -31,3 +31,7 @@
(define/match (enabled? r s) (define/match (enabled? r s)
[((reaction r i p) s) [((reaction r i p) s)
(and (subset? r s) (set-empty? (set-intersect i s)))]) (and (subset? r s) (set-empty? (set-intersect i s)))])
;;; A reaction system is a dictionary mapping reaction names to
;;; reactions.
(define-type ReactionSystem (HashTable Symbol reaction))