Python Kernel died when using Gurobi in Enthought Canopy on Win 7 -
i trying use gurobi python solve mixed integer optimization problem, every time run code wrote according gurobi tutorial, message popped up, saying: "the kernel has died, restart it? if not restart kernel, able save notebook, running code nor work until notebook reopened."
i used enthought canopy python 2.7 , gurobipy gurobi on win 7.
here small trial optimization problem tried solve, , message above showed after run it:
import gurobipy import numpy gurobipy import * def minvol(n1,solution): model=model() x=model.addvar(lb=0.0,ub=1.0,vtype=grb.continuous) y=model.addvar(lb=0.0,ub=1.0,vtype=grb.continuous) model.update() varibles=model.getvars() model.setobjective(2*x+y,grb.maximize) model.update() model.optimize() if model.status==grb.optimal: s=model.getattr('s',varibles) in range(n1): solution[i]=s[i] return true else: return false n1=2 solution=[0]*(n1) success=minvol(n1,solution) if success: print solution
anyone me this? thank much!
Comments
Post a Comment