def _presolve(self, *args, **kwds): """ kwds not consumed here or at the beginning of OptSolver._presolve will raise an error in OptSolver._presolve. args ---- pyomo Model or IBlock kwds ---- warmstart: bool can only be True if the subclass is warmstart capable; if not, an error will be raised symbolic_solver_labels: bool if True, the model will be translated using the names from the pyomo model; otherwise, the variables and constraints will be numbered with a generic xi skip_trivial_constraints: bool if True, any trivial constraints (e.g., 1 == 1) will be skipped (i.e., not passed to the solver). output_fixed_variable_bounds: bool if False, an error will be raised if a fixed variable is used in any expression rather than the value of the fixed variable. keepfiles: bool if True, the solver log file will be saved and the name of the file will be printed. kwds accepted by OptSolver._presolve """ model = args[0] if len(args) != 1: msg = ("The {0} plugin method '_presolve' must be supplied a single problem instance - {1} were " + "supplied.").format(type(self), len(args)) raise ValueError(msg) self._set_instance(model, kwds) DirectOrPersistentSolver._presolve(self, **kwds)
def _presolve(self, *args, **kwds): if len(args) != 0: msg = 'The persistent solver interface does not accept a problem instance in the solve method.' msg += ' The problem instance should be set before the solve using the set_instance method.' raise ValueError(msg) DirectOrPersistentSolver._presolve(self, *args, **kwds)
def _presolve(self, **kwds): DirectOrPersistentSolver._presolve(self, **kwds)