public virtual int makeNewPopulation(BeeParamsConf.Type_Selection selectType, int hiveSize, double percentScout, Random rand, double Border1, double Border2, double Border3, int Repeat1, int Repeat2, int Repeat3) { hostArchive.AddRange(theWorkers); hostArchive.AddRange(theOutlookers); int countafterselect = (int)(hiveSize * (1 - percentScout / 100)); hostArchive.RemoveAll(x => double.IsInfinity(x.Goods)); switch (selectType) { case BeeParamsConf.Type_Selection.Бинарный_турнир: { hostArchive = Selector.selectBinaryTornament(hostArchive, countafterselect, rand); } break; case BeeParamsConf.Type_Selection.улетка: { hostArchive = Selector.selectRoulet(hostArchive, countafterselect, rand); } break; case BeeParamsConf.Type_Selection.Случайный_отбор: { hostArchive = Selector.selectRandom(hostArchive, countafterselect, rand); } break; case BeeParamsConf.Type_Selection.Элитный_отбор: { hostArchive = Selector.selectElite(hostArchive, countafterselect); } break; } hostArchive = Selector.Regeration(hostArchive, Border1, Repeat1, Border2, Repeat2, Border3, Repeat3, countafterselect); theWorkers.Clear(); theOutlookers.Clear(); theParrent.CleanTempory(); GC.Collect(); return(hiveSize - hostArchive.Count); }
public string typeSelectionToString(BeeParamsConf.Type_Selection Source) { switch (Source) { case BeeParamsConf.Type_Selection.Бинарный_турнир: { return("Бинарныйтурнир"); } case BeeParamsConf.Type_Selection.улетка: { return("Рулетка"); } case BeeParamsConf.Type_Selection.Случайный_отбор: { return("Случайный отбор"); } case BeeParamsConf.Type_Selection.Элитный_отбор: { return("Элитный отбор"); } } return(""); }
public void Init(BeeParamsConf Config) { hiveSize = Config.ABCWHiveSize; persentScouts = Config.ABCWPercentScoutInHive; countScouts = (int)(hiveSize * persentScouts / 100); countWorkers = (int)((hiveSize - countScouts) / 2); countOutLookers = hiveSize - countScouts - countWorkers; initTemp = Config.ABCWInitTemperature; coefTemp = Config.ABCWColdCoeff; iterration = Config.ABCWCountIteration; border1 = Config.ABCWFirstBorder; repeat1 = Config.ABCWFirstRepeate; border2 = Config.ABCWSecondBorder; repeat2 = Config.ABCWSecondRepeate; border3 = Config.ABCWFirdBorder; repeat3 = Config.ABCWFirdRepeate; TypeSelection = Config.ABCWTypeSelection; }