dwave.optimization.model.Model.num_decisions#

Model.num_decisions()#

Number of independent decision nodes in the model.

An array-of-integers symbol, for example, counts as a single decision node.

Examples

This example checks the number of decisions in a model after adding a single (size 20) decision symbol.

>>> from dwave.optimization.model import Model
>>> model = Model()
>>> c = model.constant([1, 5, 8.4])
>>> i = model.integer(20, upper_bound=100)
>>> model.num_decisions()
1