Week 4.1 - Genetic Algorithm
%STALAGMITE FUNCTION
* stalagmite is aspecial type rock that the usaually formed inside the cave
*the stalagmite normally rises from the floor
*the rock formed function because the accmuluation of the material on the floor from the dripping of ceiling
*the function got name from the particular rock because of the silmiliarity with a surface graph produecd by the function
* FORMULA f(x,y) = f1,xf2xf1,yf2y
% Genetic algorithim
*the algorithim repeatedly modifies a population of individual solution
*at each step the genetic algorithim randomly selects individual from the current population and the uses as parents to produce to the next generation
% stopping criteria
*all the steps of genetic algorithim are well definied expect the stopping crietiraia
*the parctitionars use the stopping criteria based on a time or fitness value
*the time based stopping criteriz are mainly of the two kinds
*the popular one is to decide upfront the number of itration to be executed
*another is based on ececution time of the algorithim
% MAIN CODE
*writting programme for optimizing the stalagmite function using the algorithim
*the objectives is to find the glopal optimum point of stalagmite
*the optimization time will be measured for each study to compare with each other and to the most efficiancy way to use the genetic algorithim
solve optimization problem
% solve = genetic algorithim
% STALAGMITE FUNCTION CODE
function [f] = stalagmite (input_vector)
x = input_vector(1);
y = input_vector(2);
f1x = (sin(((5.1*pi).*x)+0.5)).^6;
f1y = (sin(((5.1*pi).*y)+0.5)).^6;
f2x = exp((((x-0.0667).^2)+(-4*log(2)))./0.64);
f2y = exp((((y-0.0667).^2)+(-4*log(2)))./0.64);
f = -(f1x*f1y*f2x*f2y)
end
% MAIN CODE
% stalagmite output
% stalagmite fucntion code
% ga_main code
% RESULTS
as we can that the computation time taken bye the bounded space with the increased population size is very high compare to other
% GLOBAL MAXIMA
x 0.4671144
y 0.4550.34
z 0.000263554
%LOCAL MAXIMA
x 0.0724832
y 0.0684564
z 0.0001618