Parametric Mutation Example


(define (mutate genotype)
  (let (
	(m 0.5)
	(d 0.5)
	(G genotype)
	(Gp ())
	)
    (begin
      (while (not (null? G))
        (begin
	  (if (< (rand) m)
	      (let ((gip (+ (car G) (randR (- 0 d) d))))
		(set! gip (clamp gip 0 1))
		(set! Gp (append Gp (list gip))))
	      
	      ; else
	      (set! Gp (append Gp (list (car G)))))
	  (set! G (cdr G))
	  ))
      (if (equal? Gp genotype)
	  (mutate genotype)
	  Gp)
      )))


Return to Parametric Mutation
mrl