Exemplo n.º 1
0
 public LAHC(int _tableSize = 2, double defaultTableValue = 0, Search.Direction movement = Search.Direction.Optimization)
 {
     this.Movement = movement;
     this.Table    = (new List <double>());
     for (int i = 1; i <= _tableSize; i++)
     {
         this.Table.Add(defaultTableValue);
     }
     if (movement == Search.Direction.Optimization)
     {
         defaultTableValue = double.MaxValue;
     }
     else
     {
         defaultTableValue = double.MinValue;
     }
 }
Exemplo n.º 2
0
 public BeeLahc(Func <FoodType, FoodType> mFunc, Func <FoodType, double> fFunc, BeeTypeClass _type,
                int ID = 0, int _failureLimit = 20, int _tableSize = 50, Search.Direction movement = Search.Direction.Optimization)
 {
     if ((movement == Search.Direction.Divergence))
     {
         this.Fitness   = double.MinValue;
         defaultFitness = double.MinValue;
     }
     else if (movement == Search.Direction.Optimization)
     {
         this.Fitness   = double.MaxValue;
         defaultFitness = double.MaxValue;
     }
     if (mFunc == null | fFunc == null)
     {
         throw new Exception(string.Format("Ogbeni, na Bee #{0} be this. How i wan take mutate na?", ID));
     }
     this._nonImprovementLimit = _failureLimit;
     this._mutationFunc        = mFunc;
     this._fitnessFunc         = fFunc;
     this.Type     = _type;
     this.lahc     = new LAHC(_tableSize, this.Fitness, movement);
     this.Movement = movement;
 }
Exemplo n.º 3
0
 public Bee(Func <FoodType, FoodType> mFunc, Func <FoodType, double> fFunc, BeeTypeClass _type, int ID = 0, int _failureLimit = 20, Search.Direction movement = Search.Direction.Optimization)
 {
     this.Init(mFunc, fFunc, _type, ID, _failureLimit, movement);
 }