friendlysam.opt.Domain¶
-
class
friendlysam.opt.
Domain
¶ Domain of a variable.
Variable
andVariableCollection
support these domains passed in with thedomain
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 |