-
Notifications
You must be signed in to change notification settings - Fork 33
/
xovsp.m
32 lines (27 loc) · 1.05 KB
/
xovsp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% XOVSP.M (CROSSOVer Single-Point)
%
% This function performs single-point crossover between pairs of
% individuals and returns the current generation after mating.
%
% Syntax: NewChrom = xovsp(OldChrom, XOVR)
%
% Input parameters:
% OldChrom - Matrix containing the chromosomes of the old
% population. Each line corresponds to one individual
% (in any form, not necessarily real values).
% XOVR - Probability of recombination occurring between pairs
% of individuals.
%
% Output parameter:
% NewChrom - Matrix containing the chromosomes of the population
% after mating, ready to be mutated and/or evaluated,
% in the same format as OldChrom.
%
% Author: Hartmut Pohlheim
% History: 28.03.94 file created
% 22.01.03 tested under MATLAB v6 by Alex Shenfield
function NewChrom = xovsp(OldChrom, XOVR);
if nargin < 2, XOVR = NaN; end
% call low level function with appropriate parameters
NewChrom = xovmp(OldChrom, XOVR, 1, 0);
% End of function