Skip to content

Instantly share code, notes, and snippets.

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

  • Save amineremache/5221d88e5c86fb9fc4dc9e018760b1bd to your computer and use it in GitHub Desktop.

Select an option

Save amineremache/5221d88e5c86fb9fc4dc9e018760b1bd to your computer and use it in GitHub Desktop.
The Q-localSearch implementation for Bee Swarm Optimization algorithm
def ql_localSearch(self):
for step in range(10):
state = self.solution.copy()
next_state, action, self.reward = self.data.ql.step(self.data,state)
self.fitness = self.data.ql.get_q_value(self.data,state,action)[0]
self.data.ql.learn(self.data,state,action,self.reward,next_state)
self.solution = next_state.copy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment