generic: Make fallback-dds-build-state-graph-edges collect duplicate edges.

This commit is contained in:
Sergiu Ivanov 2020-03-01 17:40:36 +01:00
parent b2f686cdaa
commit 1fa342c2ad
2 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@
;;; Provides the definition of several generic interfaces for discrete
;;; dynamical systems.
(require racket/generic graph)
(require racket/generic graph "utils.rkt")
(provide
;; Generics
@ -41,7 +41,7 @@
[labels empty]
[current-states states]
[visited-states states]
#:result (values edges labels))
#:result (collect-by-key edges labels))
([i step-range]
#:break (set-empty? current-states))
(for/fold ([new-edges empty]

View File

@ -185,25 +185,25 @@
(#hash((a . #f) (b . #t)) #hash((a . #t) (b . #t)))))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #f) (b . #f)) #hash((a . #t) (b . #f)))
(set 'a))
(list (set 'a)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #f) (b . #f)) #hash((a . #f) (b . #f)))
(set 'b))
(list (set 'b)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #t) (b . #f)) #hash((a . #t) (b . #f)))
(set 'b))
(list (set 'b)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #t) (b . #f)) #hash((a . #f) (b . #f)))
(set 'a))
(list (set 'a)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #t) (b . #t)) #hash((a . #f) (b . #t)))
(set 'a))
(list (set 'a)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #t) (b . #t)) #hash((a . #t) (b . #t)))
(set 'b))
(list (set 'b)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #f) (b . #t)) #hash((a . #f) (b . #t)))
(set 'b))
(list (set 'b)))
(check-equal? (edge-weight gr-complete-bool-ann
#hash((a . #f) (b . #t)) #hash((a . #t) (b . #t)))
(set 'a))))
(list (set 'a)))))