⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calcpopfitness.m

📁 遗传规划的matlab工具箱
💻 M
字号:
function [pop,state]=calcpopfitness(pop,params,data,state)
%CALCPOPFITNESS    Calculate fitness values for a GPLAB population.
%   CALCPOPFITNESS(POPULATION,PARAMS,DATA,STATE) returns the
%   population with the fitness values for all individuals.
%
%   [POPULATION,STATE]=CALCPOPFITNESS(...) also returns the
%   updated state of the algorithm.
%
%   Input arguments:
%      POPULATION - the current population of individuals (array)
%      PARAMS - the running parameters of the algorithm (struct)
%      DATA - the dataset on which to measure the fitness (struct)
%      STATE - the current state of the algorithm (struct)
%   Output arguments:
%      POPULATION - the population updated with fitness (array)
%      STATE - the updated state of the algorithm (struct)
%
%   See also CALCFITNESS
%
%   Copyright (C) 2003-2004 Sara Silva (sara@dei.uc.pt)
%   Acknowledgements: SINTEF (hso@sintef.no,jtt@sintef.no,okl@sintef.no)
%   This file is part of the GPLAB Toolbox

for i=1:length(pop)
   if isempty(pop(i).fitness)
      [pop(i).fitness,pop(i).result,state]=calcfitness(pop(i).str,params,data,state);
   end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -