SHARE
TWEET

Untitled

a guest Jul 17th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from gurobipy import *
  2. >>> m=Model("scanning")
  3. >>> from sympy import *
  4. >>> v=zeros(3,1)
  5. >>> ub=zeros(3,1)
  6. >>> lb=zeros(3,1)
  7. >>> x=m.addVar(lb=0,ub=3,vtype='I',name='x')
  8. >>> m.addConstr(Array([[1,2,3],[2,1,0],[2,3,1]])*x>=0,"c0")
  9. Traceback (most recent call last):
  10.   File "<stdin>", line 1, in <module>
  11.   File "/Users/midow/anaconda3/lib/python3.6/site-packages/sympy/tensor/array/ndim_array.py", line 346, in __mul__
  12.     other = sympify(other)
  13.   File "/Users/midow/anaconda3/lib/python3.6/site-packages/sympy/core/sympify.py", line 266, in sympify
  14.     if a in sympy_classes:
  15.   File "var.pxi", line 39, in gurobipy.Var.__hash__
  16. gurobipy.GurobiError: Variable has not yet been added to the model
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top