[ library(gfd) | Reference Manual | Alphabetic Index ]

get_constraints_number(?Var, -Number)

Returns the number of propagators attached to the gecode variable representing Var.
Var
A domain variable or a term
Number
Variable (instantiates to a non-negative integer)

Description

Returns the number of propagators attached to the gecode variable representing Var, This approximates the number of constraints attach to the variables, and is known as the degree of the variable in the literature.

If Var is not a variable, a very large number (1.0Inf) is returned. If Var is a variable but not a domain variable, 0 will be returned.

Note that unlike a native ECLiPSe solver like IC, this is not the number of suspensions on the variable, but is the number of propagators attached to the Gecode variable, obtained via the degree() method for IntVar. Thus, any constraints implemented at the ECLiPSe level will not be included in this count.

Modes and Determinism