Updating comments.

master
Thomas Hintz 8 years ago
parent 1adff7d035
commit 4a0b9915a0

@ -160,12 +160,12 @@
(> (alist-ref 's x1) (alist-ref 's x2))))) (> (alist-ref 's x1) (alist-ref 's x2)))))
(score companies investors))) (score companies investors)))
;; find best match and return unmatched combinations ;; greedily find best match and return unmatched combinations
(define (match/remainder taken ranks) (define (match/remainder taken ranks)
(let ((mtch (find (lambda (x) (not (memq (alist-ref 'i x) taken))) ranks))) (let ((mtch (find (lambda (x) (not (memq (alist-ref 'i x) taken))) ranks)))
(receive (head tail) (span (lambda (x) (not (eq? x mtch))) ranks) (receive (head tail) (span (lambda (x) (not (eq? x mtch))) ranks)
(if (null? tail) (if (null? tail)
(values #f head) (values #f head) ; no match found
(values (car tail) (append head (cdr tail))))))) (values (car tail) (append head (cdr tail)))))))
(define (allocate-round ranks) (define (allocate-round ranks)

Loading…
Cancel
Save