資源簡介
遺傳算法采用輪盤賭選擇,雙點交叉算法,實現(xiàn)MIMO正交波形設(shè)計。
代碼片段和文件信息
close?all;clear;clc;
overProb=0.8;??%交叉概率
mutationProb=0.01;???%變異概率
maxGeneration=1000;
popSize=60;???%種群數(shù)
CodeLength=40;??%?碼長?
N=ceil(log2(CodeLength+1));?
Register=zeros(1CodeLength);
%?traceInfo=zeros(maxGeneration4);
%?taltraceInfo=zeros(maxGeneration4);
times=1;
for?mount=1:times
%?產(chǎn)生種群數(shù)為popSize的初始化種群
startpop=size(popSizeCodeLength+1);
for?j=1:4:4*popSize
Register=round(rand(4N));%?寄存器初始值
startPop(j:j+31:CodeLength)=fourphase(CodeLengthRegister);
startPop(j:j+3CodeLength+1)=repmat(msrcost(startPop(j:j+31:CodeLength))41);
end
??
??%遺傳操作
endPop???????=?zeros(popSize*4CodeLength+1);?%A?secondary?population?matrix
p1???????????=?zeros(4CodeLength+1);? ???%An?individual
p2???????????=?zeros(4CodeLength+1);? ???%An?individual
done????
評論
共有 條評論