INTERFACE SAnnealing; (* The algorithm is essentially an interative random search procedure with adaptive moves along the coordinate directions. It permits uphill moves under the control of a probabilistic criterion, thus tending to avoid the first local minima encountered. For a description OF the algorithm, see ACM Transactions On Mathematical Software, September 1987, p. 262. *) PROCEDURE Minimize( f: GoalFunc; VAR x: ARRAY OF REAL; (* Starting point *) VAR fx: REAL; (* Out: value of "f" at optimum. *) T0: REAL := 1000.0; (* Starting temperature *) epsilon: REAL := 1.0e-3; (* Termination criterion: |fk - fopt| <= epsilon *) cu: REAL := 2.0; (* Controls the step variation along each uth direction *) Ns: CARDINAL := 20; (* Maximum number of cycles *) Nt: CARDINAL := 100; (* Maximum number of step adjustments *) Ne: CARDINAL := 4; (* Number of sucessive temperature reductions to test for termination *) rt: REAL := 0.85; (* Temperature reduction coefficient *) vm: REAL := 0.8; (* Initial step value *) ); TYPE GoalFunc = PROCEDURE (VAR x: ARRAY OF REAL; VAR y: REAL; ni: CARDINAL); END SAnnealing.