Skip to content

Instantly share code, notes, and snippets.

@amineremache
Last active January 9, 2019 13:48
Show Gist options
  • Select an option

  • Save amineremache/6e10cbf5079341c1d191d24e1c1e9c86 to your computer and use it in GitHub Desktop.

Select an option

Save amineremache/6e10cbf5079341c1d191d24e1c1e9c86 to your computer and use it in GitHub Desktop.
Bee Swarm Optimization for feature selection
def bso(self):
i=0
while(i<self.maxIterations):
#print("refSol is : ",self.refSolution.solution)
#print(self.refSolution.solution)
self.tabou.append(self.refSolution)
#print("Iteration N° : ",i)
self.searchArea()
print("********************************************************")
print("Search zone is :")
for k in range (self.nbrBees):
print(self.beeList[k].id)
print(self.beeList[k].solution)
print("*******************************************************")
# The local search
for j in range(self.nbrBees):
#self.beeList[j].localSearch()
for episode in range(5):
self.beeList[j].ql_localSearch()
print( "Fitness of bee " + str(j) + " " + str(self.beeList[j].fitness) )
self.refSolution=self.selectRefSol()
i+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment