Program testMCS USE global_constants USE samplePlans USE CuckooSearch USE matrixUtils USE optTestFunctions Implicit NONE Integer(IK) :: i,j, numDim, numNests, numGen Type(mcs_t) :: mcs Type(objtest_t) :: obj Real(RK) :: bounds(2,2) Real(RK) :: NestI(15,2), Xlhc(15,2) Real(RK) :: fexact, dx, dy Real(RK) :: xx(2) mcs%pa = 0.5_RK mcs%constrainSearch = .TRUE. mcs%pwr = 0.5_RK mcs%flightType = YangDeb_Levy mcs%numDeletedEggs = 1 mcs%numTotalGens = 100 mcs%numDesVars = 2 numNests = 15 numGen = 200 numDim = 2 bounds(:,1) = 0.0_RK bounds(:,2) = 5.0_RK xx(1) = 2.20319_RK xx(2) = 1.57049_RK Call bestlh(15,2,20,20, Xlhc,1_IK) Do i=1,15 Write(*,'(" bestlh x = ", F13.6, " bestlh y = ", F13.6)') xlhc(i,1), & xlhc(i,2) EndDo ! dx = ONE/49. ! dy = ONE/TWO ! NestI=ZERO ! Do j=1,numDIm ! Print *,' dim = ', j ! Do i = 2, numNests ! Xlhc(i,j) = Xlhc(i-1,j) + dx ! Print *,' xlhc = ', xlhc(i,j) ! EndDo ! EndDo Do i=1, numNests Do j=1,numDim NestI(i,j) = bounds(j,1) + Xlhc(i,j)*(bounds(j,2)-bounds(j,1)) EndDo EndDo Call mcs%initNests(NestI, bounds) obj%test = MICHAELWICZ_TEST Call mcs%optimizer(obj) fexact = michaelwicz(mcs%optDesVals) Do i=1,2 Write(*,'( " OptDesignVar( ",i3," ) = ", F13.6)') i, mcs%optDesVals(i) EndDo Write(*, '( " Foptim = ", F13.6)') fexact fexact = michaelwicz(xx) Print *,'' Write(*, '( " Foptim_yang = ", F13.6)') fexact Print *,'' Print *,'' Do i = 1, numNests fexact = michaelwicz(NestI(i,:)) Write (*,' (" mikex = ", F13.6, " mikey= ", F13.6, " mikeval = ", & & F13.6)') nesti(i,1), nesti(i,2), fexact EndDo End Program testMCS