Simulated annealing: Difference between revisions
Content deleted Content added
Line 1,956:
y (fx+ i 1))))))
(define (
(let loop ((E (distance**2 (vector-ref vec 0)
(vector-ref vec 99)))
Line 1,987:
(let* ((temperature (make-temperature-procedure kT kmax))
(s0 (make-s0))
(E0 (
(kmax/10 (fxquotient kmax 10))
(show (lambda (k T E s)
Line 2,001:
(_ (show k T E s))
(s^ (s->s s))
(E^ (
(delta-E (fx- E^ E))
(P (probability delta-E T)))
Line 2,041:
(newline)
(newline)
(format #t "Final E(s): ~,5F~%" (
(format #t "Final path length: ~,5F~%" (path-length s-final))
(newline)</lang>
|