Esempio n. 1
0
        /// Shift the best points toward positive positions.
        private void MoveTowardPositive()
        {
            OptimizingPoint newPoint = _pointFactory.CreatePoint(
                3 * _bestPoints[2].Position
                - 2 * _bestPoints[1].Position, _f);

            _bestPoints[0] = _bestPoints[1];
            _bestPoints[1] = _bestPoints[2];
            _bestPoints[2] = newPoint;
        }
Esempio n. 2
0
        /// Apply bisection on points 1 and n
        /// @param n int	index of worst point of bisected interval
        private void ReducePoints(int n)
        {
            double x = _bestPoints[1].Position;

            x += GoldenSection * (_bestPoints[n].Position - x);
            OptimizingPoint newPoint = _pointFactory.CreatePoint(x, _f);

            if (newPoint.BetterThan(_bestPoints[1]))
            {
                _bestPoints[2 - n] = _bestPoints[1];
                _bestPoints[1]     = newPoint;
            }
            else
            {
                _bestPoints[n] = newPoint;
            }
        }
Esempio n. 3
0
 /// @return boolean	true if the receiver is "better" than
 ///												the supplied point
 /// @param point OptimizingPoint
 public override bool BetterThan(OptimizingPoint point)
 {
     return(this.Value < point.Value);
 }
Esempio n. 4
0
 /// @return boolean	true if the receiver is "better" than
 ///												the supplied point
 /// @param point OptimizingPoint
 public abstract bool BetterThan(OptimizingPoint entity);