friendlysam.opt.Domain

class friendlysam.opt.Domain

Domain of a variable.

Variable and VariableCollection support these domains passed in with the domain keyword argument of the constructor.

Examples

>>> for d in Domain:
...     print(d)
...
Domain.real
Domain.integer
Domain.binary
>>> s = get_solver()
>>> prob = Problem()
>>> x = Variable('x', domain=Domain.integer)
>>> prob.objective = Minimize(x)
>>> prob += (x >= 41.5)
>>> solution = s.solve(prob)
>>> solution[x] == 42
True
Domain.binary
Domain.integer
Domain.real