Exemplo n.º 1
0
        public virtual void Dance(SimpleBee rhs, double[] sides, object constraints) //local search around rhs
        {
            double[] localLowerBounds = mLowerBounds;
            double[] localUpperBounds = mUpperBounds;

            RandomSearch(localLowerBounds, localUpperBounds, constraints);
        }
Exemplo n.º 2
0
        public virtual SimpleBee Clone() //factory method
        {
            SimpleBee bee = new SimpleBee(mSwarm, mData.Length, mLowerBounds, mUpperBounds);

            for (int i = 0; i < mData.Length; ++i)
            {
                bee[i] = mData[i];
            }
            bee.mCost = mCost;
            return(bee);
        }
Exemplo n.º 3
0
        public BeeSwarm(int _n, int _n1, int _n2, int _m, int _e, CostEvaluationMethod evaluator)
        {
            mScoutBeeCount         = _n;
            mBeeCount_BestPatches  = _n1;
            mBeeCount_ElitePatches = _n2;

            mBestPatchCount  = _m;
            mElitePatchCount = _e;

            mBeeGenerator = () =>
            {
                SimpleBee p = new SimpleBee(this, mLowerBounds.Length, mLowerBounds, mUpperBounds);
                p.Initialize(Constraints);
                return(p as Bee);
            };
            mEvaluator = evaluator;
        }
Exemplo n.º 4
0
 public double Evaluate(SimpleBee bee)
 {
     return(mEvaluator(bee));
 }