예제 #1
0
 def print_to_string(cls, solutions, indent=None):
     oss = StringIO()
     cls.print_to_stream(solutions, out=oss, indent=indent)
     return oss.getvalue()
예제 #2
0
 def to_string(self, print_zeros=True):
     oss = StringIO()
     self.to_stringio(oss, print_zeros=print_zeros)
     return oss.getvalue()
예제 #3
0
 def _export_as_string(self, fmt, **kwargs):
     oss = StringIO()
     printer = self.get_printer(fmt)
     printer.print_to_stream(self, oss, **kwargs)
     return oss.getvalue()
예제 #4
0
 def _serialize_relaxables(self, relaxables):
     oss = StringIO()
     FeasibilityPrinter.print_to_stream(out=oss, relaxables=relaxables)
     serialized_relaxables = oss.getvalue()
     return serialized_relaxables
예제 #5
0
 def print_to_string(cls, solutions):
     oss = StringIO()
     cls.print_to_stream(solutions, out=oss)
     return oss.getvalue()
예제 #6
0
 def print_to_string(cls, mdl):
     oss = StringIO()
     cls.print_to_stream(mdl, out=oss)
     return oss.getvalue()
예제 #7
0
 def print_to_string(cls, solutions, write_level=WriteLevel.Auto, **kwargs):
     from docplex.mp.compat23 import StringIO
     oss = StringIO()
     cls.print_to_stream(solutions, out=oss, write_level=write_level, **kwargs)
     return oss.getvalue()