27.06.2013 Views

Evolution and Optimum Seeking

Evolution and Optimum Seeking

Evolution and Optimum Seeking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

380 Appendix B<br />

instead of T, as a parameter. If it is a subroutine, the user can program the required<br />

function. For example, the subroutine might be called SECOND(I), where parameter I is<br />

an integer representing the CPU time in microseconds, in which case one could program:<br />

-----------------------------------------------------<br />

FUNCTION T(D)<br />

CALL SECOND(I)<br />

T=1.E-6*FLOAT(I)<br />

RETURN<br />

END<br />

-----------------------------------------------------<br />

7.4 Function for transforming a uniformly distributed r<strong>and</strong>om number to a normally<br />

distributed one<br />

See under 8.<br />

7.5 Function for generating a uniform r<strong>and</strong>om number distribution in the range (0,1]<br />

The structure must be<br />

REAL FUNCTION R(D)<br />

where D is dummy. R is the value of the r<strong>and</strong>om number.<br />

Note: The smallest value of R must be large enough for the natural logarithm to be generated<br />

without oating-point over ow. The st<strong>and</strong>ard library usually includes a suitable<br />

program, in which case only the appropriate name has to be supplied to GRUP.<br />

8. Function Z(S,R)<br />

This function converts a uniform r<strong>and</strong>om number distribution to a normal distribution<br />

pairwise by means of the Box-Muller rules. The st<strong>and</strong>ard deviation is supplied as parameter<br />

S, while the expectation value for the mean is always zero. The quantity LZis<br />

common to GRUP <strong>and</strong> Z by virtue of a COMMON block <strong>and</strong> acts as a switch to transmit<br />

only one of the two r<strong>and</strong>om numbers generated in response to each second call.<br />

---------------------------------------------------------<br />

SUBROUTINE GRUP(REKO,L,LL,N,M,LF,TM,EA,EB,EC,ED,SN,<br />

1FA,FB,XB,SM,X,FK,XK,SK,F,G,T,Z,R)<br />

LOGICAL REKO<br />

DIMENSION XB(1),SM(1),X(1),FK(1),XK(1),SK(1)<br />

COMMON/GRZ/LZ<br />

EXTERNAL R<br />

KK(RR)=(LA+IFIX(FLOAT(L)*RR))*N<br />

C<br />

C THE PRECEDING LINE CONTAINS A STATEMENT FUNCTION<br />

C<br />

TN=TM+T(D)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!