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

📄 updatenodeids.m

📁 The Source of Genetic Programming developed in Matlab
💻 M
字号:
function tree=updatenodeids(tree,d)
%UPDATENODEIDS    Updates the node ids of a GPLAB tree.
%   UPDATENODEIDS(TREE,DIFFERENCE) returns TREE with DIFFERENCE
%   added to all its node ids.
%   
%   Input arguments:
%      TREE - the tree to update the node ids (struct)
%      DIFFERENCE - the value to add to the node ids (integer)
%   Output arguments:
%      TREE - the tree with updated node ids (struct)
%
%   See also SWAPNODES
%
%   Copyright (C) 2003-2007 Sara Silva (sara@dei.uc.pt)
%   This file is part of the GPLAB Toolbox

tree.nodeid=tree.nodeid+d;
tree.maxid=tree.maxid+d;

for i=1:length(tree.kids)
   tree.kids{i}=updatenodeids(tree.kids{i},d);
end

⌨️ 快捷键说明

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