System.err.println("Objective function of best solution: " + tc.getBestObjective());
    public double[] solve() throws LPSolverFailedException {	// setup model	ModelAndVars mv = null;	try {	    mv = setupModel();	} catch (IloException e) {	    throw new LPSolverFailedException("CPLEX setup failed due to its own exception: " + e);	} catch (IOException e) {	    throw new LPSolverFailedException("CPLEX setup failed due to I/O error: " + e);	}	IloCplex model = mv.model;	IloNumVar[] x = mv.x;	// try solving model	double[] result;	// add a callback to keep track of timeout	TimeoutCallback tc = new TimeoutCallback(this.timeout, x);	try {	    model.use(tc);	    if (model.solve()) {		result = model.getValues(x);	    } else {		throw new LPSolverFailedException("CPLEX returned false from IloCplex.solve()");	    }	} catch (IloException e) {	    // we end up here if we aborted the solution for a	    // timeout.  See if this is the case and fail if it isn't.	    result = tc.getBestSolution();	    // if we hadn't found one yet, then there's still a problem	    if (result==null) {		throw new LPSolverFailedException("CPLEX solver failed due to its own exception: " + e);	    }	}	model.end();	return result;    }