实参
类似报志愿,可以随便写,但是要是确定的值(数字,数组,字母)
不需要写类型,也不用全都是变量
/*MainWindow.cpp*/
pso = new PSO(getpsize, "func_16_Ziz", 0, 0, getmaxgen, getpoint, getcycle);
pso类中写Result类的指针,是要用Result类结果
/*pso.cpp*/
xc_result = new Result(psize, point);
粒子群初始化时,调用适应度函数func_16_Ziz();pop_row是一个确定的值,代入到result类进行计算。
/*pso.cpp*/
pBestFit[i] = xc_result->func_16_Ziz(pop_row);
形参
报名一时爽,调剂火葬场,追着实参写形参
/*pso.cpp*/
PSO::PSO(int dim, QString mode_kind, int mode_popmax, int mode_pop, int time_maxgen, int time_point, int time_cycle)
/*result.cpp*/
Result::Result(int dim, int time_point)
iValue已经是确定的值了
/*result.cpp*/
double Result::func_16_Ziz(vector<double> &iValue){……}