docplex.mp.model_stats module

class docplex.mp.model_stats.ModelStatistics[source]

Bases: object

This class gathers statistics from the model.

Instances of this class are returned by the method docplex.mp.model.Model.get_statistics().

The class contains counters on the various types of variables and constraints in the model.

number_of_binary_variables

This property returns the number of binary decision variables in the model.

number_of_continuous_variables

This property returns the number of continuous decision variables in the model.

number_of_eq_constraints

This property returns the number of == constraints

number_of_equivalence_constraints

This property returns the number of equivalence constraints.

number_of_ge_constraints

This property returns the number of >= constraints

number_of_indicator_constraints

This property returns the number of indicator constraints.

number_of_integer_variables

This property returns the number of integer decision variables in the model.

number_of_le_constraints

This property returns the number of <= constraints

number_of_linear_constraints

This property returns the total number of linear constraints in the model.

This number comprises all relational constraints: <=, ==, and >= and also range constraints.

number_of_quadratic_constraints

This property returns the number of quadratic constraints.

number_of_range_constraints

This property returns the number of range constraints.

Range constraints are of the form L <= expression <= U.

number_of_semicontinuous_variables

This property returns the number of semicontinuous decision variables in the model.

number_of_semiinteger_variables

This property returns the number of semi-integer decision variables in the model.

number_of_variables

This property returns the total number of variables in the model.

print_information()[source]

Prints model statistics in readable format.