This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ fvalOfElite, xVal ] = gago( fun, valMin, valMax, tolerance, popSize, generationsNum, crossProb, mutateProb ) | |
%GAGO genetic algorithm | |
% | |
% output: | |
% fvalOfElite: the minimum of the function | |
% xVal: the point that the function gets the minimum | |
% | |
% input: | |
% fun: the name of the function, e.g. 'afunc' | |
% valMin: the low limitation of the variables, e.g. [-10,-pi] |