Forum Discussion
FICO
6 years agoCommunity Manager
xpress.InterfaceError: Incorrect control name error
I upgraded FICO Xpress Optimization from version 8.8.0 to 8.9.3. The following used to work in the python3 interface of version 8.8.0: import xpress as xp
xp.controls.outputlog = 0 # disable all s...
FICO
6 years agoCommunity Manager
Hi Chris, it seems you are correct. I'm indeed using an OEM license with linux, and the XPRESS environment variable points to the OEM license file.
import xpress as xp
oemnum = hidden
string= ""
n,string = xp.license(0,string)
lic = oemnum - n*n//19
n,string = xp.license(lic,string)
xp.controls.outputlog = 0
S = range(5) # that's the set {0,1,2,3,4}
value = [102, 512, 218, 332, 41] # or just read them from file
weight = [21, 98, 44, 59, 9]
x = [xp.var(vartype=xp.binary) for i in S]
profit = xp.Sum(value[i] * x[i] for i in S)
p = xp.problem("knapsack")
p.addVariable(x)
p.addConstraint(xp.Sum(weight[i] * x[i] for i in S) <= 130)
p.setObjective(profit, sense=xp.maximize)
p.solve()The code snippet above didn't work and produced the aforementioned error. However, replacing lines 3-6 with:
if (xp.beginlicensing()):
string = ""
n,string = xp.license(0,string)
lic = oemnum - n*n//19
n,string = xp.license(lic,string)
xp.init()
xp.endlicensing()solved the problem.
Also note that, the first code block works fine if line 8 is commented out. This is very confusing and should probably throw a more descriptive error than 'xpress.InterfaceError: Incorrect control name', i.e. some error that points to the licensing issue.
Related Content
Related Content
Rare occurrences of exception xpress.InterfaceError: Incorrect control name
We have an optimization job that ~2% of the time fails with xpress.InterfaceError: Incorrect control name when trying to set xp.controls.miprelstop. This is the first line of code in our solver funct...3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread0Views0likes3CommentsHow to resolve traceback: "xpress.InterfaceError: Incorrect control name; check name and license type"?
We are trying to access xpress in Python via Pyomo. We have no issues installing xpress and solving a simple model with the xpress interface. However, when we attempt to access xpress via pyomo we re...2 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread1View0likes1CommentOptimizer controls in Python
Could you please point to a reference of the solver controls that can be set from Python API (package xpress)? It seems that the names are not the same as in Mosel (e.g., XPRS_MIPRELSTOP and XPRS_VE...4 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread0Views0likes5Comments