MCPcopy Create free account
hub / github.com/caelan/pddlstream / process_until_new

Method process_until_new

pddlstream/algorithms/skeleton.py:358–380  ·  view source on GitHub ↗
(self, print_frequency=1.)

Source from the content-addressed store, hash-verified

356 return num_new
357
358 def process_until_new(self, print_frequency=1.):
359 # TODO: process the entire queue for one pass instead
360 num_new = 0
361 if not self.is_active():
362 return num_new
363 print('Sampling until new output values')
364 iterations = 0
365 last_time = time.time()
366 while self.is_active() and (not num_new):
367 iterations += 1
368 _, binding = self.pop_binding()
369 readd, is_new = self._process_binding(binding)
370 if readd is True:
371 self.push_binding(binding)
372 elif readd is STANDBY:
373 self.standby.append(binding) # TODO: test for deciding whether to standby
374 num_new += is_new
375 if print_frequency <= elapsed_time(last_time):
376 print('Queue: {} | Iterations: {} | Time: {:.3f}'.format(
377 len(self.queue), iterations, elapsed_time(last_time)))
378 last_time = time.time()
379 self.readd_standby()
380 return num_new + self.greedily_process()
381
382 def process_complexity(self, complexity_limit):
383 # TODO: could copy the queue and filter instances that exceed complexity_limit

Callers 1

processMethod · 0.95

Calls 7

is_activeMethod · 0.95
pop_bindingMethod · 0.95
_process_bindingMethod · 0.95
push_bindingMethod · 0.95
readd_standbyMethod · 0.95
greedily_processMethod · 0.95
elapsed_timeFunction · 0.90

Tested by

no test coverage detected