ffa0db4fdca9cef31a72b35a1f7eef78733f5b0c,glyph/cli/glyph_remote.py,RemoteAssessmentRunner,evaluate_single,#RemoteAssessmentRunner#Any#,207
Before Change
def evaluate_single(self, individual, *consts):
Evaluate a single individual.
cache = {}
payload = [self.make_str(t) for t in individual]
for k, v in zip(individual.pset.constants, consts):
payload = [s.replace(k, str(v)) for s in payload]
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]
def measure(self, individual):
Construct fitness for given individual.
After Change
self.queue.put((key, payload))
self.evaluations += 1
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.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: Ambrosys/glyph
Commit Name: ffa0db4fdca9cef31a72b35a1f7eef78733f5b0c
Time: 2017-02-24
Author: mquade@uni-potsdam.de
File Name: glyph/cli/glyph_remote.py
Class Name: RemoteAssessmentRunner
Method Name: evaluate_single
Project Name: pantsbuild/pants
Commit Name: 6101d42a47f4dca09a862090f7665bf83373f9d8
Time: 2013-07-29
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/nailgun_task.py
Class Name: NailgunTask
Method Name: _await_nailgun_server
Project Name: pantsbuild/pants
Commit Name: 7dcc1b532d21e47c98ba2422cab7d48360149f89
Time: 2013-10-06
Author: benjyw@gmail.com
File Name: src/python/twitter/pants/tasks/nailgun_task.py
Class Name: NailgunTask
Method Name: _await_nailgun_server