From a92542d0cd358ab7ba1427d7e044b8c5b9e75275 Mon Sep 17 00:00:00 2001 From: TianZhendong <33273211+TianZhendong@users.noreply.github.com> Date: Thu, 11 Apr 2019 21:46:40 +0800 Subject: [PATCH] Create crossover --- GA/crossover | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 GA/crossover diff --git a/GA/crossover b/GA/crossover new file mode 100644 index 0000000..c2fedd1 --- /dev/null +++ b/GA/crossover @@ -0,0 +1,10 @@ +function [y1,y2] = crossover(acr_position,x1,x2) +%交叉 +for i=1:acr_position + temp = x1(i); + x1(i)=x2(i); + x2(i)=temp; +end +y1=x1; +y2=x2; +end