private void kryptonButton1_Click(object sender, EventArgs e) { createGridPopulationMember(); double[] hasil = new double[popmemberawal.GetLongLength(0)]; for (int i = 0; i < popmemberawal.GetLongLength(0); i++) { hasil[i] = FunctionVariabel.goldsteinprice(popmemberawal[i, 0], popmemberawal[i, 1]); } MakeGrid.Build(grid1, (int)popmemberawal.GetLongLength(0), 1, MakeGrid.HeaderColumnsHeader.none); MakeGrid.Fill(grid1, hasil); }
private double getfunctionvalue(int tipefungsi, double X, double Y) { switch (tipefungsi) { case 0: return(FunctionVariabel.goldsteinprice(X, Y)); case 1: return(Andi.Fungsi.Bohachevsky.getValue(X, Y, Enums.BohaType.Boha1)); case 2: return(Andi.Fungsi.Bohachevsky.getValue(X, Y, Enums.BohaType.Boha2)); case 3: return(Andi.Fungsi.Bohachevsky.getValue(X, Y, Enums.BohaType.Boha3)); case 4: return(FunctionVariabel.fourpeaks(X, Y)); default: return(0); } }