0
我是新來的數學,我試圖創建一個輸入功能,這將返回後代的列表遺傳算法,但代碼返回數學 - 函數返回列表
Null Return[{}]
後要求子女的數量。我如何讓代碼運行並返回輸入的後代列表?謝謝!
inputData[]:= (
i = 1
offspring = {};
offspringSize = Input["Enter number of offspring"];
While[i <= offspringSize,
n = Input[
"Enter data in form {Potential 1, Potential 2, Number of cycles, \
Cycle Length, Wave Form, Result}"];
offspring = Append[offspring, n];
n =.;
i++;
];
Print[offspring]
Return[offspring]
);
newData = inputData[]
幾個語句缺少終止分號的初始值 – agentp