All pastes #81589 Raw Edit

dikini

public text v1 · immutable
·published 2006-07-07 17:35 UTC
rendered paste body
;; build a list with the new coordinates
(define (simple/filter/generic coordinate-values random/coord local/adjust better? old-best new-size scouts) 
  (letrec ([old-populous (mergesort coordinate-values better?)]
        [new-seeds (take old-populous old-best)]
        [new-scouts (list-ec (: i scouts) (random/coord))]
        [new-workers (list-ec 
                      (: i (- new-size scouts))
                         (local/adjust (cdr (list-ref list (modulo i old-best)))))])
    (append! new-workers new-scouts)))