Beispiel #1
0
        /// <summary>
        ///     Construct the object and init.
        /// </summary>
        public KnapsackAnneal()
            : base(1000, 40000, 0.001)
        {
            _currentTaken = new bool[NumItemsToChoose];
            _backupTaken  = new bool[NumItemsToChoose];
            _bestTaken    = new bool[NumItemsToChoose];

            for (int i = 0; i < _currentTaken.Length; i++)
            {
                _currentTaken[i] = _rnd.NextBoolean();
            }
            Balance();
        }