Example #1
0
 def __init__(self, nb_digits=6, sort_variable_names=False):
     # comment line is // as in OPL
     # do NOT forget about user names
     # no encoding is printed
     TextModelPrinter.__init__(self, indent=2, comment_start='//',
                               nb_digits_for_floats=nb_digits,
                               hide_user_names=False,
                               encoding=None,
                               sort_variable_names=sort_variable_names)
Example #2
0
    def __init__(self, hide_user_names=False, **kwargs):
        nb_digits = self.float_precision_64 if env_is_64_bit() else self.float_precision_32
        TextModelPrinter.__init__(self,
                                  indent=1,
                                  comment_start='\\',
                                  hide_user_names=hide_user_names,
                                  nb_digits_for_floats=nb_digits)

        self._noncompliant_varname = None
        # specific printer for lp: do not print +inf/-inf inside constraints!
        self._lp_num_printer = _NumPrinter(nb_digits_for_floats=nb_digits,
                                           num_infinity=1e+20, pinf="1e+20", ninf="-1e+20")
        self._print_full_obj = kwargs.get('full_obj', False)