static void Main(string[] args) { PSO foo = new PSO(); foo.DoPSO(); Console.ReadKey(); }
private void BtnRun_Click(object sender, EventArgs e) { pso = new PSO((int)nudPopulation.Value, (int)nudItrations.Value); pso.SetData(((double)nudWeight.Value, (double)nudDamp.Value, new double[] { (double)nudCoefficients1.Value, (double)nudCoefficients2.Value })); // Event handlers pso.OnStart += PSO_OnStart; pso.OnIteration += PSO_OnIteration; pso.OnEnd += PSO_OnEnd; pso.Run(optimizationProblem); }
public void SetParam(string RawF, int s, double low, double up) { Function f = new Function("f(x) = " + RawF); pso = new PSO(f, s, low, up); }