|
|
|
@ -111,8 +111,12 @@ This class describes finite-domain Constraint Satisfaction Problems.
|
|
|
|
|
(define result null)
|
|
|
|
|
(for ([val (in-list (hash-ref domains var))])
|
|
|
|
|
(when (= (nconflicts var val assignment) 0)
|
|
|
|
|
;; what does this mean?
|
|
|
|
|
;; a = assignment.copy; a[var] = val
|
|
|
|
|
(define a (hash-copy assignment)) ;; !! typo fix in original
|
|
|
|
|
(hash-set! a var val)
|
|
|
|
|
(set! result (append result (cons (cons var val) a)))))
|
|
|
|
|
result)))
|
|
|
|
|
|
|
|
|
|
;; todo: calls to append need to mutate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -530,4 +534,3 @@ def solve_zebra(algorithm=min_conflicts, **args):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|#
|
|
|
|
|
|