Check whether the solver received a response for a submitted problem. Non-blocking call that checks whether the solver has received a response from the remote resource. Returns: Boolean: True if solver received a response. Examples: This exa
(self)
| 444 | return self._results_ready_event.wait(timeout) |
| 445 | |
| 446 | def done(self): |
| 447 | """Check whether the solver received a response for a submitted problem. |
| 448 | |
| 449 | Non-blocking call that checks whether the solver has received a response |
| 450 | from the remote resource. |
| 451 | |
| 452 | Returns: |
| 453 | Boolean: True if solver received a response. |
| 454 | |
| 455 | Examples: |
| 456 | This example creates a solver using the local system's default |
| 457 | D-Wave Cloud Client configuration file, submits a simple QUBO |
| 458 | problem to a remote D-Wave resource for 100 samples, and checks a |
| 459 | couple of times whether sampling is completed. |
| 460 | |
| 461 | >>> from dwave.cloud import Client |
| 462 | >>> client = Client.from_config() # doctest: +SKIP |
| 463 | >>> solver = client.get_solver() # doctest: +SKIP |
| 464 | >>> u, v = next(iter(solver.edges)) # doctest: +SKIP |
| 465 | >>> Q = {(u, u): -1, (u, v): 0, (v, u): 2, (v, v): -1} # doctest: +SKIP |
| 466 | >>> computation = solver.sample_qubo(Q, num_reads=100) # doctest: +SKIP |
| 467 | >>> computation.done() # doctest: +SKIP |
| 468 | False |
| 469 | >>> computation.done() # doctest: +SKIP |
| 470 | True |
| 471 | >>> client.close() # doctest: +SKIP |
| 472 | """ |
| 473 | return self._results_ready_event.is_set() |
| 474 | |
| 475 | def cancel(self): |
| 476 | """Try to cancel the problem corresponding to this result. |
no outgoing calls