key = sum(map(hash, payload)) // constants may have been simplified, not in payload anymore.
if key not in cache:
self.send(dict(action="EXPERIMENT", payload=payload))
cache[key] = self.recv()["fitness"]
self.evaluations += 1
return cache[key]
After Change
result = None
while result is None:
sleep(1)
result = self.result_queue.get(key)return result
def measure(self, individual):
Construct fitness for given individual.
popt, error = const_opt_scalar(self.evaluate_single, individual, method=glyph.utils.numeric.hill_climb, options=self.options)