def __init__(self, root_algo_paras=None, cso_paras=None): """ :param root_paras: :param cat_paras: # mixture_ratio - joining seeking mode with tracing mode # smp - seeking memory pool, 10 clones (lon cang tot, nhugn ton time hon) # spc - self-position considering # cdc - counts of dimension to change (lon cang tot) # srd - seeking range of the selected dimension (nho thi tot nhung search lau hon) # w_minmax - same in PSO # c1 - same in PSO # selected_strategy : 0: best fitness, 1: tournament, 2: roulette wheel, 3: random (decrease by quality) """ RootAlgo.__init__(self, root_algo_paras) self.epoch = cso_paras["epoch"] self.pop_size = cso_paras["pop_size"] self.mixture_ratio = cso_paras["mixture_ratio"] self.smp = cso_paras["smp"] self.spc = cso_paras["spc"] self.cdc = cso_paras["cdc"] self.srd = cso_paras["srd"] self.w_min = cso_paras["w_minmax"][0] self.w_max = cso_paras["w_minmax"][1] self.c1 = cso_paras["c1"] # Still using c1 and r1 but not c2, r2 self.selected_strategy = cso_paras["selected_strategy"]
def __init__(self, root_algo_paras=None, cro_paras=None): """ # reef_size: size of the reef, NxM square grids, each grid stores a solution # po: the rate between free/occupied at the beginning # Fb: BroadcastSpawner/ExistingCorals rate # Fa: fraction of corals duplicates its self and tries to settle in a different part of the reef # Fd: fraction of the worse health corals in reef will be applied depredation # Pd: Probabilty of depredation # k : number of attempts for a larvar to set in the reef. # reef: a maxtrix of dictionaries, each of those store a space's information (occupied/solution/health) # occupied_corals: position of occupied corals in reef-matrix (array 1dimension, each element store a position) # unselected_corals: corals in occupied_corals that aren't selected in broadcastSpawning # larvae: all larva ready to setting # sorted_health: a list of position, refer to position of each solution in reef-matrix, was sorted according to coral's health """ RootAlgo.__init__(self, root_algo_paras) self.epoch = cro_paras["epoch"] self.pop_size = cro_paras["pop_size"] # ~ number of space self.po = cro_paras["po"] self.Fb = cro_paras["Fb"] self.Fa = cro_paras["Fa"] self.Fd = cro_paras["Fd"] self.Pd_thres = cro_paras["Pd"] self.Pd = 0 self.k = cro_paras["k"] self.G = cro_paras["G"] self.GCR = cro_paras["GCR"] self.G1 = cro_paras["G"][1] self.reef = np.array([]) self.occupied_position = [ ] # after a gen, you should update the occupied_position self.alpha = 10 * self.Pd / self.epoch self.gama = 10 * (self.G[1] - self.G[0]) / self.epoch
def __init__(self, root_algo_paras=None, bmo_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = bmo_paras["epoch"] self.pop_size = bmo_paras["pop_size"] self.bm_teams = bmo_paras["bm_teams"] # Number of blue monkey teams (5, 10, 20, ...) self.bm_size = int(self.pop_size/2) # Number of all blue monkey self.bm_numbers = int(self.bm_size / self.bm_teams) # Number of blue monkey in each team
def __init__(self, root_algo_paras=None, nmr_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = nmr_paras["epoch"] self.pop_size = nmr_paras["pop_size"] self.size_b = int(self.pop_size / 5) self.size_w = self.pop_size - self.size_b self.bp = nmr_paras["bp"] # breeding probability (0.5)
def __init__(self, root_algo_paras=None, pso_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = pso_paras["epoch"] self.pop_size = pso_paras["pop_size"] self.c1 = pso_paras["c_minmax"][0] self.c2 = pso_paras["c_minmax"][1] self.w_min = pso_paras["w_minmax"][0] self.w_max = pso_paras["w_minmax"][1]
def __init__(self, root_algo_paras=None, sfo_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = sfo_paras["epoch"] self.pop_size = sfo_paras["pop_size"] # SailFish pop size self.pp = sfo_paras["pp"] # the rate between SailFish and Sardines (N_sf = N_s * pp) = 0.25, 0.2, 0.1 self.A = sfo_paras["A"] # A = 4, 6,... self.epxilon = sfo_paras["epxilon"] # = 0.0001, 0.001
def __init__(self, root_algo_paras=None, boa_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = boa_paras["epoch"] self.pop_size = boa_paras["pop_size"] self.c = boa_paras["c"] # 0.01, is the sensory modality self.p = boa_paras[ "p"] # 0.8, Search for food and mating partner by butterflies can occur at both local and global scale self.alpha = boa_paras[ "alpha"] # 0.1-0.3 (0 -> vo cung), the power exponent dependent on modality
def __init__(self, root_algo_paras=None, gso_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = gso_paras["epoch"][0] self.epoch_subswarm = gso_paras["epoch"][1] self.epoch_superswarm = gso_paras["epoch"][2] self.pop_size = gso_paras["pop_size"] self.c1 = gso_paras["c_minmax"][0] self.c2 = gso_paras["c_minmax"][1] self.w_min = gso_paras["w_minmax"][0] self.w_max = gso_paras["w_minmax"][1] self.num_subswarm = gso_paras["num_subswarm"]
def __init__(self, root_algo_paras=None, abc_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = abc_paras["epoch"] self.pop_size = abc_paras["pop_size"] self.e_bees = abc_paras["couple_bees"][0] self.o_bees = abc_paras["couple_bees"][1] self.patch_size = abc_paras["patch_variables"][0] self.patch_factor = abc_paras["patch_variables"][1] self.num_sites = abc_paras["sites"][0] self.elite_sites = abc_paras["sites"][1]
def __init__(self, root_algo_paras=None, abfols_paras=None): RootAlgo.__init__(self, root_algo_paras) # algorithm configuration self.epoch = abfols_paras["epoch"] self.pop_size = abfols_paras["pop_size"] self.step_size = abfols_paras["Ci"] # Ci self.p_eliminate = abfols_paras["Ped"] # Ped self.swim_length = abfols_paras["Ns"] # Ns self.N_adapt = abfols_paras["N_minmax"][0] # Dead threshold value self.N_split = abfols_paras["N_minmax"][1] # split threshold value self.C_s = self.step_size[0] * (self.domain_range[1] - self.domain_range[0]) self.C_e = self.step_size[1] * (self.domain_range[1] - self.domain_range[0])
def __init__(self, root_algo_paras=None, bfo_paras=None): RootAlgo.__init__(self, root_algo_paras) # algorithm configuration self.pop_size = bfo_paras["pop_size"] self.step_size = bfo_paras["Ci"] # Ci self.p_eliminate = bfo_paras["Ped"] # Ped self.swim_length = bfo_paras["Ns"] # Ns self.elim_disp_steps = bfo_paras["Ned"] # Ned self.repro_steps = bfo_paras["Nre"] # Nre self.chem_steps = bfo_paras["Nc"] # Nc self.d_attr = bfo_paras["attract_repel"][0] self.w_attr = bfo_paras["attract_repel"][1] self.h_rep = bfo_paras["attract_repel"][2] self.w_rep = bfo_paras["attract_repel"][3]
def __init__(self, root_algo_paras=None, two_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = two_paras["epoch"] self.pop_size = two_paras["pop_size"]
def __init__(self, root_algo_paras=None, hgso_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = hgso_paras["epoch"] self.pop_size = hgso_paras["pop_size"] self.n_clusters = hgso_paras["n_clusters"] self.n_elements = int(self.pop_size / self.n_clusters)
def __init__(self, root_algo_paras=None, ga_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = ga_paras["epoch"] self.pop_size = ga_paras["pop_size"] self.pc = ga_paras["pc"] self.pm = ga_paras["pm"]
def __init__(self, root_algo_paras=None, isfo_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = isfo_paras["epoch"] self.pop_size = isfo_paras["pop_size"] # SailFish pop size self.pp = isfo_paras["pp"] # the rate between SailFish and Sardines (N_sf = N_s * pp) = 0.1, 0.01, 0.001
def __init__(self, root_algo_paras=None, de_paras=None): RootAlgo.__init__(self, root_algo_paras) self.epoch = de_paras["epoch"] self.pop_size = de_paras["pop_size"] self.weighting_factor = de_paras["Wf"] self.crossover_rate = de_paras["Cr"]