private double calculateFitness(Vector2d particlePosition, SwarmOptimum optimum)
        {
            Vector2d diff = particlePosition - optimum.GetPosition();
            double baseFitness = Math.Pow((Math.Pow(Math.Abs(diff.X), P) + Math.Pow(Math.Abs(diff.Y), P)), ((double)1.0 / P));

            if (IgnoreWeights)
            {
                return baseFitness;
            }

            return baseFitness / (double)optimum.GetWeight();
        }
        private void addOptimum_Click(object sender, EventArgs e)
        {
            Vector2d position = new Vector2d(int.Parse(xInput.Text), int.Parse(yInput.Text));
            int weight = int.Parse(weightInput.Text);
            if (weight <= 0)
            {
                weight = 1;
            }
            SwarmOptimum optimum = new SwarmOptimum(position, weight);

            Optima.Add(optimum);
            optimaCheckedList.Items.Add(optimum);
        }