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

📄 tspdemo.m

📁 其中提到遺傳學的程式碼與應用提供給次淚相向的研究者參考下載
💻 M
字号:
% allsims.m
% Matlab program to get the simulation results for the different TSP's
% with varying number of cities between 20 and 100 with jumps of 5

clear all
clear global
format compact

Nall    = input('Number of cities: '); %[50];
no_gens = 10000;
Area = 100*100;
threshold = 1.1*0.749*sqrt(Area)*sqrt(Nall);
PopSize = input('Number of Parents: ');
for i = 1:length(Nall)
  close all
  clear global
  clear functions

  N = Nall(i)
  new_threshold = threshold(i)
  
  rand('seed',0);
  randn('seed',0);  
  
  [xopt, optJ, P, S, xoptAll] = eptsp(PopSize,N,10,no_gens(i),threshold(i),10);
  %[xopt, optJ, P, S] = epsatsp(PopSize,N,10,no_gens(i),threshold(i),1);
  eval(sprintf('save epsa%g',N));
end

⌨️ 快捷键说明

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