(self, complexity_limit)
| 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 |
| 384 | num_new = 0 |
| 385 | if not self.is_active(): |
| 386 | return num_new |
| 387 | print('Sampling while complexity <= {}'.format(complexity_limit)) |
| 388 | while self.is_active(): |
| 389 | _, binding = self.pop_binding() |
| 390 | if binding.check_complexity(complexity_limit): # not binding.up_to_date() or |
| 391 | readd, is_new = self._process_binding(binding) |
| 392 | num_new += is_new |
| 393 | if readd is not STANDBY: |
| 394 | if readd is True: |
| 395 | self.push_binding(binding) |
| 396 | continue |
| 397 | self.standby.append(binding) |
| 398 | self.readd_standby() |
| 399 | return num_new + self.greedily_process() |
| 400 | # TODO: increment the complexity level even more if nothing below in the queue |
| 401 | |
| 402 | def timed_process(self, max_time=INF, max_iterations=INF): |
| 403 | # TODO: combine process methods into process_until |
no test coverage detected