pymzn.Solutions¶
-
class
pymzn.Solutions(queue, *, keep=True)¶ Solution stream returned by the
pymzn.minizincfunction.You should not need to instantiate this class in any other way than by calling the
pymzn.minizincor thepymzn.aio.minizincfunctions. This class represents lazy list-like objects that collect the solutions provided by the solver and parsed by the PyMzn solution parser. The solution parser provides solutions to this object through a queue that is only accessed when this object is addressed or iterated over. If the queue has limited size (by using themax_queue_sizeoption of thepymzn.aio.minizincfunction), the execution of the solver will halt untill this object is addressed. Note that, by default, as soon as this object is addressed, the full queue is processed and it is cached in memory. To avoid this behavior, use the optionkeep_solutions=Truein thepymzn.minizincorpymzn.aio.minizincfunctions.- Parameters
status (Status) – The status of the solution stream, i.e. whether it is complete, the problem was unsatisfiable or other errors that might have occurred.
log (str) – The log of the solver on standard output. Usually contains solver statistics and other log messages.
stderr (str) – The log of the MiniZinc executable on standard error. Usually contains log messages about the flattening process, statistics and error messages.
Methods
print([output_file, log])Print the solution stream