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

📄 gazbgradeval.m

📁 研究多年的遗传算法代码!与大家共享!能实现最优化算法!
💻 M
字号:
function [nsol, val] = gaZBGradEval(sol,options)

% This evaluation function takes in a potential solution and two options
% options(3) is the percent of time to perform the gradient heuristic to the
% potential solution
% options(4) is the percentage of time to update the solution based on the
% outcome of the gradient heuristic
% options [currentGen maxGen eval_with_constr update_with_constr]
nsol=sol;
if (rand<options(2))
  % Perform a gradient search
  global bounds;
  [x opt]=constr('gaZBGrad',sol(1:2),[],bounds(:,1),bounds(:,2));
  % opt(8) is the objective val...
      val=-opt(8);
  if (rand<options(3))
    nsol(1:2)=x;
  end
else
  val=-gaTestEval(sol(1:2),[]);
end

⌨️ 快捷键说明

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