dds-step -> dds-step-one

This commit is contained in:
Sergiu Ivanov 2020-02-23 12:23:55 +01:00
parent c79c23ada3
commit 5907edfef0
3 changed files with 6 additions and 6 deletions

View File

@ -11,11 +11,11 @@
;; Generics
gen:dds
;; Functions
(contract-out [dds-step (-> dds? any/c (set/c any/c))])
(contract-out [dds-step-one (-> dds? any/c (set/c any/c))])
;; Predicates
(contract-out [dds? (-> any/c boolean?)]))
;;; A discrete dynamical system.
(define-generics dds
;; Given a dds and a state, produce the next states of the dds.
(dds-step dds state))
(dds-step-one dds state))

View File

@ -112,6 +112,6 @@
[asyn (make-asyn-dynamics n)]
[syn (make-syn-dynamics n)]
[s (st '((a . #t) (b . #f)))])
(check-equal? (dds-step asyn s) (set (st '((a . #f) (b . #f)))
(check-equal? (dds-step-one asyn s) (set (st '((a . #f) (b . #f)))
(st '((a . #t) (b . #f)))))
(check-equal? (dds-step syn s) (set (st '((a . #f) (b . #f)))))))
(check-equal? (dds-step-one syn s) (set (st '((a . #f) (b . #f)))))))

View File

@ -36,7 +36,7 @@
[make-dynamics-from-func (-> network? (-> (listof variable?) mode?) dynamics?)]
[make-asyn-dynamics (-> network? dynamics?)]
[make-syn-dynamics (-> network? dynamics?)]
[dds-step (-> dynamics? state? (set/c state?))]
[dds-step-one (-> dynamics? state? (set/c state?))]
)
;; Predicates
(contract-out [variable? (-> any/c boolean?)]
@ -262,7 +262,7 @@
;;; A network dynamics is a network plus a mode.
(struct dynamics (network mode)
#:methods gen:dds
[(define/match (dds-step dyn s)
[(define/match (dds-step-one dyn s)
[((dynamics network mode) s)
(for/set ([m mode]) (update network s m))])])