def print_to_string(cls, solutions, indent=None): oss = StringIO() cls.print_to_stream(solutions, out=oss, indent=indent) return oss.getvalue()
def to_string(self, print_zeros=True): oss = StringIO() self.to_stringio(oss, print_zeros=print_zeros) return oss.getvalue()
def _export_as_string(self, fmt, **kwargs): oss = StringIO() printer = self.get_printer(fmt) printer.print_to_stream(self, oss, **kwargs) return oss.getvalue()
def _serialize_relaxables(self, relaxables): oss = StringIO() FeasibilityPrinter.print_to_stream(out=oss, relaxables=relaxables) serialized_relaxables = oss.getvalue() return serialized_relaxables
def print_to_string(cls, solutions): oss = StringIO() cls.print_to_stream(solutions, out=oss) return oss.getvalue()
def print_to_string(cls, mdl): oss = StringIO() cls.print_to_stream(mdl, out=oss) return oss.getvalue()
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()