Java API Reference#
This section documents the Gurobi Java interface. This manual begins with a quick overview of the classes exposed in the interface and the most important methods on those classes. It then continues with a comprehensive presentation of all of the available classes and methods.
If you prefer Javadoc format, documentation for the Gurobi Java interface is
also available in file gurobi-javadoc.jar. Javadoc format is particularly
helpful when used from an integrated development environment like Eclipse.
Please consult the documentation for your IDE for information on how to import
Javadoc files.
If you are new to the Gurobi Optimizer, we suggest that you start with the Getting Started Knowledge Base article for general information. This also includes Tutorials for the different Gurobi APIs. Additionally, our Example Tour provides concrete examples of how to use the classes and methods described here. We will point to sections or examples of this tour whenever it fits in this overview.
You will find instructions on how to install the Gurobi Java interface in the Gurobi Java API installation guide.
Contents
- Overview
- Environments
- Models
- Solving a Model
- Multiple Solutions, Objectives, and Scenarios
- Infeasible Models
- Querying and Modifying Attributes
- Additional Model Modification Information
- Lazy Updates
- Managing Parameters
- Memory Management
- Native Code
- Monitoring Progress - Logging and Callbacks
- Modifying Solver Behavior - Callbacks
- Batch Optimization
- Error Handling
- GRBEnv
- GRBModel
GRBModelGRBModel.GRBModelGRBModel.GRBModelGRBModel.GRBModelGRBModel.GRBModelGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrGRBModel.addConstrsGRBModel.addConstrsGRBModel.addConstrsGRBModel.addGenConstrMaxGRBModel.addGenConstrMinGRBModel.addGenConstrAbsGRBModel.addGenConstrAndGRBModel.addGenConstrOrGRBModel.addGenConstrNormGRBModel.addGenConstrNLGRBModel.addGenConstrIndicatorGRBModel.addGenConstrPWLGRBModel.addGenConstrPolyGRBModel.addGenConstrExpGRBModel.addGenConstrExpAGRBModel.addGenConstrLogGRBModel.addGenConstrLogAGRBModel.addGenConstrLogisticGRBModel.addGenConstrPowGRBModel.addGenConstrSinGRBModel.addGenConstrCosGRBModel.addGenConstrTanGRBModel.addQConstrGRBModel.addQConstrGRBModel.addQConstrGRBModel.addQConstrGRBModel.addQConstrGRBModel.addQConstrGRBModel.addQConstrGRBModel.addRangeGRBModel.addRangesGRBModel.addSOSGRBModel.addVarGRBModel.addVarGRBModel.addVarGRBModel.addVarsGRBModel.addVarsGRBModel.addVarsGRBModel.addVarsGRBModel.chgCoeffGRBModel.chgCoeffsGRBModel.computeIISGRBModel.convertToFixedGRBModel.discardConcurrentEnvsGRBModel.discardMultiobjEnvsGRBModel.disposeGRBModel.feasRelaxGRBModel.feasRelaxGRBModel.fixedModelGRBModel.get[Param]GRBModel.get[Attr]GRBModel.get[Attr,1D]GRBModel.get[Attr,1D]GRBModel.get[Attr,2D]GRBModel.get[Attr,3D]GRBModel.getCoeffGRBModel.getColGRBModel.getConcurrentEnvGRBModel.getConstrByNameGRBModel.getConstrsGRBModel.getGenConstrMaxGRBModel.getGenConstrMinGRBModel.getGenConstrAbsGRBModel.getGenConstrAndGRBModel.getGenConstrOrGRBModel.getGenConstrNormGRBModel.getGenConstrNLGRBModel.getGenConstrIndicatorGRBModel.getGenConstrPWLGRBModel.getGenConstrPolyGRBModel.getGenConstrExpGRBModel.getGenConstrExpAGRBModel.getGenConstrLogGRBModel.getGenConstrLogAGRBModel.getGenConstrLogisticGRBModel.getGenConstrPowGRBModel.getGenConstrSinGRBModel.getGenConstrCosGRBModel.getGenConstrTanGRBModel.getGenConstrsGRBModel.getJSONSolutionGRBModel.getMultiobjEnvGRBModel.getObjectiveGRBModel.getObjectiveGRBModel.getPWLObjGRBModel.getQCRowGRBModel.getQConstrsGRBModel.getRowGRBModel.getSOSGRBModel.getSOSsGRBModel.getTuneResultGRBModel.getVarByNameGRBModel.getVarsGRBModel.optimizeGRBModel.optimizeasyncGRBModel.optimizeBatchGRBModel.presolveGRBModel.readGRBModel.removeGRBModel.resetGRBModel.resetGRBModel.setCallbackGRBModel.set[Param]GRBModel.set[Param]GRBModel.set[Attr]GRBModel.set[Attr,1D]GRBModel.set[Attr,1D]GRBModel.set[Attr,2D]GRBModel.set[Attr,3D]GRBModel.setLogCallbackGRBModel.setObjectiveGRBModel.setObjectiveGRBModel.setObjectiveNGRBModel.setPWLObjGRBModel.singleScenarioModelGRBModel.syncGRBModel.terminateGRBModel.tuneGRBModel.updateGRBModel.write
- GRBVar
- GRBConstr
- GRBQConstr
- GRBSOS
- GRBGenConstr
- GRBExpr
- GRBLinExpr
GRBLinExprGRBLinExpr.GRBLinExprGRBLinExpr.GRBLinExprGRBLinExpr.addGRBLinExpr.addConstantGRBLinExpr.addTermGRBLinExpr.addTermsGRBLinExpr.addTermsGRBLinExpr.clearGRBLinExpr.getConstantGRBLinExpr.getCoeffGRBLinExpr.getValueGRBLinExpr.getVarGRBLinExpr.multAddGRBLinExpr.removeGRBLinExpr.removeGRBLinExpr.size
- GRBQuadExpr
GRBQuadExprGRBQuadExpr.GRBQuadExprGRBQuadExpr.GRBQuadExprGRBQuadExpr.GRBQuadExprGRBQuadExpr.addGRBQuadExpr.addGRBQuadExpr.addConstantGRBQuadExpr.addTermGRBQuadExpr.addTermGRBQuadExpr.addTermsGRBQuadExpr.addTermsGRBQuadExpr.addTermsGRBQuadExpr.addTermsGRBQuadExpr.clearGRBQuadExpr.getCoeffGRBQuadExpr.getLinExprGRBQuadExpr.getValueGRBQuadExpr.getVar1GRBQuadExpr.getVar2GRBQuadExpr.multAddGRBQuadExpr.multAddGRBQuadExpr.removeGRBQuadExpr.removeGRBQuadExpr.size
- GRBColumn
- GRBCallback
GRBCallbackGRBCallback.GRBCallbackGRBCallback.abortGRBCallback.addCutGRBCallback.addLazyGRBCallback.getDoubleInfoGRBCallback.getIntInfoGRBCallback.getNodeRelGRBCallback.getNodeRelGRBCallback.getNodeRelGRBCallback.getSolutionGRBCallback.getSolutionGRBCallback.getSolutionGRBCallback.getStringInfoGRBCallback.proceedGRBCallback.setGRBCallback.setGRBCallback.setGRBCallback.setSolutionGRBCallback.setSolutionGRBCallback.stopOneMultiObjGRBCallback.useSolution
- GRBException
- GRBBatch
- GRB