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
%% Monkey Evolutionary Algorithm | |
clear;close all;clc; | |
tic | |
target = ('MORE GIDDY IN MY DESIRES THAN A MONKEY'); | |
ideal = double(target); | |
best = inf; | |
Gen = 0; | |
phrase = randi([min(ideal) max(ideal)],1,length(target)); | |
for Gen = 1:1e6 %arbitrarily large | |
% Monkey 1 |
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
%% Standard Genetic Algorithm -- Solves For A User Input String | |
clear;close all;clc; %Clears variables, closes windows, and clears the command window | |
tic % Begins the timer | |
%% Select Target String | |
target = 'Hello, world!'; | |
% *Can Be Any String With Any Values and Any Length!* | |
%% Parameters |
NewerOlder