def _reset_problem_type(self):
<EOL>if self._solve_count > <NUM_LIT:0>:<EOL><INDENT>integer_count = <NUM_LIT:0><EOL>for func in (self._cp.variables.get_num_binary,<EOL>self._cp.variables.get_num_integer,<EOL>self._cp.variables.get_num_semicontinuous,<EOL>self._cp.variables.get_num_semiinteger):<EOL><INDENT>integer_count += func()<EOL><DEDENT>integer = integer_count > <NUM_LIT:0><EOL>quad_constr = self._cp.quadratic_constraints.get_num() > <NUM_LIT:0><EOL>quad_obj = self._cp.objective.get_num_quadratic_variables() > <NUM_LIT:0><EOL>if not integer:<EOL><INDENT>if quad_constr:<EOL><INDENT>new_type = self._cp.problem_type.QCP<EOL><DEDENT>elif quad_obj:<EOL><INDENT>new_type = self._cp.problem_type.QP<EOL><DEDENT>else:<EOL><INDENT>new_type = self._cp.problem_type.LP<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if quad_constr:<EOL><INDENT>new_type = self._cp.problem_type.MIQCP<EOL><DEDENT>elif quad_obj:<EOL><INDENT>new_type = self._cp.problem_type.MIQP<EOL><DEDENT>else:<EOL><INDENT>new_type = self._cp.problem_type.MILP<EOL><DEDENT><DEDENT>logger.debug('<STR_LIT>'.format(<EOL>self._cp.problem_type[new_type]))<EOL>self._cp.set_problem_type(new_type)<EOL><DEDENT>else:<EOL><INDENT>logger.debug('<STR_LIT>'.format(<EOL>self._cp.problem_type[self._cp.get_problem_type()]))<EOL><DEDENT>quad_obj = self._cp.objective.get_num_quadratic_variables() > <NUM_LIT:0><EOL>if hasattr(self._cp.parameters, '<STR_LIT>'):<EOL><INDENT>target_param = self._cp.parameters.optimalitytarget<EOL><DEDENT>else:<EOL><INDENT>target_param = self._cp.parameters.solutiontarget<EOL><DEDENT>if quad_obj:<EOL><INDENT>target_param.set(target_param.values.optimal_global)<EOL><DEDENT>else:<EOL><INDENT>target_param.set(target_param.values.auto)<EOL><DEDENT>
Reset problem type to whatever is appropriate.