gurobipy 13.0.0b1__cp313-cp313-manylinux_2_26_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gurobipy might be problematic. Click here for more details.
- gurobipy/.libs/gurobi.lic +6 -0
- gurobipy/.libs/libgurobi130.so +0 -0
- gurobipy/__init__.py +139 -0
- gurobipy/__init__.pyi +3364 -0
- gurobipy/_attrconst.py +477 -0
- gurobipy/_attrutil.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_batch.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_callbackconst.py +206 -0
- gurobipy/_core.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_errorconst.py +80 -0
- gurobipy/_exception.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_grb.py +298 -0
- gurobipy/_helpers.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_load_model.py +169 -0
- gurobipy/_lowlevel.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_matrixapi.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_model.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_modelutil.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/_paramconst.py +491 -0
- gurobipy/_paramdetails.py +2068 -0
- gurobipy/_statusconst.py +47 -0
- gurobipy/_util.cpython-313-aarch64-linux-gnu.so +0 -0
- gurobipy/nlfunc.py +34 -0
- gurobipy/nlfunc.pyi +52 -0
- gurobipy/py.typed +0 -0
- gurobipy-13.0.0b1.dist-info/METADATA +347 -0
- gurobipy-13.0.0b1.dist-info/RECORD +30 -0
- gurobipy-13.0.0b1.dist-info/WHEEL +5 -0
- gurobipy-13.0.0b1.dist-info/licenses/LICENSE.txt +3174 -0
- gurobipy-13.0.0b1.dist-info/top_level.txt +1 -0
gurobipy/_attrconst.py
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
# Wrapper for 'GRB.Attr' object
|
|
2
|
+
|
|
3
|
+
class AttrConstClass(object):
|
|
4
|
+
'''
|
|
5
|
+
Attributes are used throughout the Gurobi interface to query and
|
|
6
|
+
modify model properties. You refer to them as you would any
|
|
7
|
+
other object attribute. For example, "print model.numConstrs"
|
|
8
|
+
prints the number of constraints in a model. You can assign new values to
|
|
9
|
+
some attributes (e.g., model.ModelName = "New"), while others can only
|
|
10
|
+
be queried. Note that attribute modification is handled in a lazy fashion,
|
|
11
|
+
so you won't see the effect of a change until after the next call to
|
|
12
|
+
Model.update() or Model.optimize().
|
|
13
|
+
|
|
14
|
+
Capitalization is ignored in Gurobi attribute names, so
|
|
15
|
+
model.numConstrs and model.NumConstrs are equivalent.
|
|
16
|
+
|
|
17
|
+
Gurobi attributes can be grouped into the following categories:
|
|
18
|
+
|
|
19
|
+
General model attributes (e.g., model.numConstrs):
|
|
20
|
+
|
|
21
|
+
numConstrs: Number of constraints
|
|
22
|
+
numVars: Number of variables
|
|
23
|
+
numSOS: Number of SOS constraints
|
|
24
|
+
numQConstrs: Number of quadrtic constraints
|
|
25
|
+
numGenConstrs: Number of general constraints
|
|
26
|
+
numNZs: Number of non-zero coefficients
|
|
27
|
+
dNumNZs: Number of non-zero coefficients (in double format)
|
|
28
|
+
numQNZs: Number of non-zero quadratic objective coefficients
|
|
29
|
+
numIntVars: Number of integer variables (including binary variables)
|
|
30
|
+
numBinVars: Number of binary variables
|
|
31
|
+
modelName: Model name
|
|
32
|
+
modelSense: Model sense: minimization (1) or maximization (-1)
|
|
33
|
+
objCon: Constant offset for objective function
|
|
34
|
+
objVal: Objective value for current solution
|
|
35
|
+
objBound: Best available lower bound on solution objective
|
|
36
|
+
poolObjBound: Bound on objective for undiscovered solutions
|
|
37
|
+
poolNObjVal: Retrieve the objective value of an alternate MIP solution
|
|
38
|
+
poolObjVal: Deprecated since v13 - use poolNObjVal instead
|
|
39
|
+
MIPGap: Current relative MIP optimality gap
|
|
40
|
+
runtime: Runtime (in seconds) for most recent optimization
|
|
41
|
+
work: Work (in work units) for most recent optimization
|
|
42
|
+
Status: Current status of model (help(GRB) gives a list of codes)
|
|
43
|
+
ConcurrentWinMethod: Winning method that solved the continuous problem with concurrent optimization
|
|
44
|
+
solCount: Number of stored solutions
|
|
45
|
+
iterCount: Number of simplex iterations performed
|
|
46
|
+
nodeCount: Number of branch-and-cut nodes explored
|
|
47
|
+
barIterCount: Number of barrier iterations performed
|
|
48
|
+
nlbarIterCount: Number of NL barrier iterations performed
|
|
49
|
+
PDHGIterCount: Number of PDHG iterations performed
|
|
50
|
+
isMIP: Indicates whether the model is MIP (1) or not (0)
|
|
51
|
+
isQP: Indicates whether the model has a quadratic objective
|
|
52
|
+
isQCP: Indicates whether the model has quadratic constraints
|
|
53
|
+
isMultiObj: Indicates whether the model has multiple objectives
|
|
54
|
+
IISMinimal: Is computed IIS minimal?
|
|
55
|
+
kappa: Condition number of current LP basis
|
|
56
|
+
maxCoeff: Maximum constraint coefficient (in absolute value)
|
|
57
|
+
minCoeff: Minimum non-zero constraint coefficient (in absolute value)
|
|
58
|
+
maxBound: Maximum finite variable bound (in absolute value)
|
|
59
|
+
minBound: Minimum non-zero variable bound (in absolute value)
|
|
60
|
+
maxObjCoeff: Maximum objective coefficient (in absolute value)
|
|
61
|
+
minObjCoeff: Minimum objective coefficient (in absolute value)
|
|
62
|
+
maxRHS: Maximum linear constraint right-hand side (in absolute value)
|
|
63
|
+
minRHS: Minimum linear constraint right-hand side (in absolute value)
|
|
64
|
+
maxQCRHS: Maximum quadratic constraint right-hand side (in absolute value)
|
|
65
|
+
minQCRHS: Minimum quadratic constraint right-hand side (in absolute value)
|
|
66
|
+
maxQCCoeff: Maximum quadratic constraint coefficient in quadratic part (in absolute value)
|
|
67
|
+
minQCCoeff: Minimum non-zero quadratic constraint coefficient in quadratic part (in absolute value)
|
|
68
|
+
maxQCLCoeff: Maximum quadratic constraint coefficient in linear part (in absolute value)
|
|
69
|
+
minQCLCoeff: Minimum non-zero quadratic constraint coefficient in linear part (in absolute value)
|
|
70
|
+
maxQObjCoeff: Maximum quadratic objective coefficient (in absolute value)
|
|
71
|
+
minQObjCoeff: Minimum quadratic objective coefficient (in absolute value)
|
|
72
|
+
farkasProof: Infeasible amount for Farkas proof for infeasible models
|
|
73
|
+
numStart: number of MIP starts
|
|
74
|
+
fingerprint: fingerprint computed from the model data and attributes influencing the optimization process
|
|
75
|
+
MemUsed: Current amount of memory allocated (in GB) in master environment
|
|
76
|
+
MaxMemUsed: Maximum amount of memory allocated (in GB) in master environment
|
|
77
|
+
|
|
78
|
+
Variable attributes (e.g., var.lb):
|
|
79
|
+
|
|
80
|
+
lb: Lower bound
|
|
81
|
+
ub: Upper bound
|
|
82
|
+
obj: Objective coefficient
|
|
83
|
+
vType: Variable type (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER,
|
|
84
|
+
GRB.SEMICONT, or GRB.SEMIINT)
|
|
85
|
+
varName: Variable name
|
|
86
|
+
x: Solution value
|
|
87
|
+
rc: Reduced cost
|
|
88
|
+
poolNX: Solution value in alternate MIP solution
|
|
89
|
+
xn: Deprecated since v13 - use poolNX instead
|
|
90
|
+
start: Start vector (use GRB.UNDEFINED to leave a value unspecified)
|
|
91
|
+
vBasis: Basis status
|
|
92
|
+
varHintVal: Variable hint value
|
|
93
|
+
varHintPri: Variable hint priority
|
|
94
|
+
branchPriority: Variable branch priority
|
|
95
|
+
partition: Variable partition
|
|
96
|
+
poolIgnore: Ignore the variable in the solution identity check of the solution pool
|
|
97
|
+
IISLB: Does LB participate in IIS? (for infeasible models)
|
|
98
|
+
IISUB: Does UB participate in IIS? (for infeasible models)
|
|
99
|
+
IISLBForce: Forces the lower bound to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
100
|
+
IISUBForce: Forces the upper bound to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
101
|
+
SAObjLow: Smallest objective coefficient for which basis remains optimal
|
|
102
|
+
SAObjUp: Largest objective coefficient for which basis remains optimal
|
|
103
|
+
SALBLow: Smallest lower bound for which basis remains optimal
|
|
104
|
+
SALBUp: Largest lower bound for which basis remains optimal
|
|
105
|
+
SAUBLow: Smallest upper bound for which basis remains optimal
|
|
106
|
+
SAUBUp: Largest upper bound for which basis remains optimal
|
|
107
|
+
unbdRay: Unbounded ray
|
|
108
|
+
pStart: Primal solution (for warm-starting simplex)
|
|
109
|
+
preFixVal: The value of the variable (for variables fixed by presolve)
|
|
110
|
+
varPreStat: Status of variable in presolved model
|
|
111
|
+
VTag: Tag string for variables (each defined variable tag MUST be unique)
|
|
112
|
+
|
|
113
|
+
Constraint attributes (e.g., constr.sense):
|
|
114
|
+
|
|
115
|
+
sense: Constraint sense
|
|
116
|
+
rhs: Constraint right-hand side value
|
|
117
|
+
constrName: Constraint name
|
|
118
|
+
pi: Dual value
|
|
119
|
+
slack: Constraint slack
|
|
120
|
+
cBasis: Basis status
|
|
121
|
+
lazy: Lazy constraint flag
|
|
122
|
+
IISConstr: Does constraint participate in IIS? (for infeasible models)
|
|
123
|
+
IISConstrForce: Forces the constraint to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
124
|
+
SARHSLow: Smallest RHS value for which basis remains optimal
|
|
125
|
+
SARHSUp: Largest RHS value for which basis remains optimal
|
|
126
|
+
farkasDual: Farkas dual for infeasible models
|
|
127
|
+
dStart: Dual solution (for warm-starting simplex)
|
|
128
|
+
CTag: Tag string for constraints (each defined constraint tag MUST be unique)
|
|
129
|
+
|
|
130
|
+
SOS (e.g., sos.IISSOS):
|
|
131
|
+
|
|
132
|
+
IISSOS: Does SOS participate in IIS? (for infeasible models)
|
|
133
|
+
IISSOSForce: Forces the SOS constraint to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
134
|
+
|
|
135
|
+
Quadratic constraint attributes (e.g., qc.sense):
|
|
136
|
+
|
|
137
|
+
QCsense: Quadratic constraint sense
|
|
138
|
+
QCrhs: Quadratic constraint right-hand side value
|
|
139
|
+
QCname: Quadratic constraint name
|
|
140
|
+
IISQConstr: Does quadratic constraint participate in IIS? (for infeasible models)
|
|
141
|
+
IISQConstrForce: Forces the quadratic constraint to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
142
|
+
QCpi: Dual value
|
|
143
|
+
QCslack: Quadratic constraint slack
|
|
144
|
+
QCTag: Tag string for quadratic constraints (each defined
|
|
145
|
+
quadratic constraint tag MUST be unique)
|
|
146
|
+
|
|
147
|
+
GenConstr (e.g., genconstr.IISGenConstr):
|
|
148
|
+
|
|
149
|
+
GenConstrType: General constraint type (e.g., GRB.GENCONSTR_MAX)
|
|
150
|
+
GenConstrName: General constraint name
|
|
151
|
+
IISGenConstr: Does general constraint participate in IIS? (for infeasible models)
|
|
152
|
+
IISGenConstrForce: Forces the general constraint to be in (1) the final IIS or to be not in (0) the final IIS (for infeasible models)
|
|
153
|
+
|
|
154
|
+
GenConstr (only for function constraints)
|
|
155
|
+
|
|
156
|
+
FuncPieceError: error allowed for PWL translation
|
|
157
|
+
FuncPieceLength: piece length for PWL translation
|
|
158
|
+
FuncPieceRatio: control whether to link function values or to have
|
|
159
|
+
pieces below or above the function
|
|
160
|
+
FuncPieces: control PWL translation whether to use equal piece length,
|
|
161
|
+
to limit error or to limit the total number of pieces
|
|
162
|
+
FuncNonlinear: control whether the function is treated as nonlinear or
|
|
163
|
+
as a PWL approximation
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
Solution quality (e.g., model.constrVio):
|
|
167
|
+
|
|
168
|
+
You generally access quality information through Model.printQuality().
|
|
169
|
+
Please refer to the Attributes section of the Gurobi Reference Manual for
|
|
170
|
+
the full list of quality attributes.
|
|
171
|
+
|
|
172
|
+
Multi-objectives
|
|
173
|
+
|
|
174
|
+
ObjN: objectives of multi-objectives
|
|
175
|
+
ObjNCon: constant terms of multi-objectives
|
|
176
|
+
ObjNPriority: priorities of multi-objectives
|
|
177
|
+
ObjNWeight: weights of multi-objectives
|
|
178
|
+
ObjNRelTol: relative tolerances of multi-objectives
|
|
179
|
+
ObjNAbsTol: absolute tolerances of multi-objectives
|
|
180
|
+
ObjNVal: objective value for multi-objectives
|
|
181
|
+
ObjNName: names of multi-objectives
|
|
182
|
+
NumObj: number of multi-objectives
|
|
183
|
+
|
|
184
|
+
NumObjPasses: number of optimization passes during the multi-objective solve
|
|
185
|
+
ObjNPass: optimization pass in which the selected objective function was solved
|
|
186
|
+
ObjNPassIterCount: simplex iteration count for a pass during the multi-objective solve
|
|
187
|
+
ObjNPassMIPGap: MIP gap for a pass during the multi-objective solve
|
|
188
|
+
ObjNPassNodeCount: number of explored nodes for a pass during the multi-objective solve
|
|
189
|
+
ObjNPassObjBound: objective bound for a pass during the multi-objective solve
|
|
190
|
+
ObjNPassObjVal: objective value for a pass during the multi-objective solve
|
|
191
|
+
ObjNPassOpenNodeCount: number of unexplored nodes for a pass during the multi-objective solve
|
|
192
|
+
ObjNPassRuntime: run time for a pass during the multi-objective solve
|
|
193
|
+
ObjNPassStatus: status for a pass during the multi-objective solve
|
|
194
|
+
ObjNPassWork: work done for a pass during the multi-objective solve
|
|
195
|
+
|
|
196
|
+
Multi-scenarios
|
|
197
|
+
|
|
198
|
+
ScenNLB: modification to lower bound vector in current scenario
|
|
199
|
+
ScenNUB: modification to upper bound vector in current scenario
|
|
200
|
+
ScenNObj: modification to objective coefficient vector in current scenario
|
|
201
|
+
ScenNRHS: modification to right hand side vector in current scenario
|
|
202
|
+
ScenNName: name of current scenario
|
|
203
|
+
ScenNX: value in current solution of current scenario
|
|
204
|
+
ScenNObjBound: objective bound of current scenario
|
|
205
|
+
ScenNObjVal: objective value of current solution of current scenario
|
|
206
|
+
NumScenarios: number of scenarios in multi-scenario model
|
|
207
|
+
|
|
208
|
+
Batch Objects
|
|
209
|
+
|
|
210
|
+
BatchErrorCode: Last error code for this batch request
|
|
211
|
+
BatchErrorMessage: Last error string for this batch request
|
|
212
|
+
BatchID: String ID for this batch request
|
|
213
|
+
BatchStatus: Current status of batch request (help(GRB) gives a list of codes)
|
|
214
|
+
|
|
215
|
+
'''
|
|
216
|
+
|
|
217
|
+
def __setattr__(self, name, value):
|
|
218
|
+
raise AttributeError("Gurobi attribute constants are not modifiable")
|
|
219
|
+
|
|
220
|
+
# General model attributes
|
|
221
|
+
|
|
222
|
+
NumConstrs = "NumConstrs"
|
|
223
|
+
NumVars = "NumVars"
|
|
224
|
+
NumSOS = "NumSOS"
|
|
225
|
+
NumQConstrs = "NumQConstrs"
|
|
226
|
+
NumGenConstrs = "NumGenConstrs"
|
|
227
|
+
NumNZs = "NumNZs"
|
|
228
|
+
DNumNZs = "DNumNZs"
|
|
229
|
+
NumQNZs = "NumQNZs"
|
|
230
|
+
NumQCNZs = "NumQCNZs"
|
|
231
|
+
NumIntVars = "NumIntVars"
|
|
232
|
+
NumBinVars = "NumBinVars"
|
|
233
|
+
NumPWLObjVars = "NumPWLObjVars"
|
|
234
|
+
ModelName = "ModelName"
|
|
235
|
+
ModelSense = "ModelSense"
|
|
236
|
+
ObjCon = "ObjCon"
|
|
237
|
+
IsMIP = "IsMIP"
|
|
238
|
+
IsQP = "IsQP"
|
|
239
|
+
IsQCP = "IsQCP"
|
|
240
|
+
IsMultiObj = "IsMultiObj"
|
|
241
|
+
IISMinimal = "IISMinimal"
|
|
242
|
+
Kappa = "Kappa"
|
|
243
|
+
KappaExact = "KappaExact"
|
|
244
|
+
MaxCoeff = "MaxCoeff"
|
|
245
|
+
MinCoeff = "MinCoeff"
|
|
246
|
+
MaxBound = "MaxBound"
|
|
247
|
+
MinBound = "MinBound"
|
|
248
|
+
MaxObjCoeff = "MaxObjCoeff"
|
|
249
|
+
MinObjCoeff = "MinObjCoeff"
|
|
250
|
+
MaxRHS = "MaxRHS"
|
|
251
|
+
MinRHS = "MinRHS"
|
|
252
|
+
MaxQCRHS = "MaxQCRHS"
|
|
253
|
+
MinQCRHS = "MinQCRHS"
|
|
254
|
+
MaxQCCoeff = "MaxQCCoeff"
|
|
255
|
+
MinQCCoeff = "MinQCCoeff"
|
|
256
|
+
MaxQCLCoeff = "MaxQCLCoeff"
|
|
257
|
+
MinQCLCoeff = "MinQCLCoeff"
|
|
258
|
+
MaxQObjCoeff = "MaxQObjCoeff"
|
|
259
|
+
MinQObjCoeff = "MinQObjCoeff"
|
|
260
|
+
ObjVal = "ObjVal"
|
|
261
|
+
ObjBound = "ObjBound"
|
|
262
|
+
ObjBoundC = "ObjBoundC"
|
|
263
|
+
PoolObjBound = "PoolObjBound"
|
|
264
|
+
PoolNObjVal = "PoolNObjVal"
|
|
265
|
+
PoolObjVal = "PoolObjVal"
|
|
266
|
+
MIPGap = "MIPGap"
|
|
267
|
+
Runtime = "Runtime"
|
|
268
|
+
Work = "Work"
|
|
269
|
+
Status = "Status"
|
|
270
|
+
SolCount = "SolCount"
|
|
271
|
+
IterCount = "IterCount"
|
|
272
|
+
NodeCount = "NodeCount"
|
|
273
|
+
BarStatus = "BarStatus"
|
|
274
|
+
BarIterCount = "BarIterCount"
|
|
275
|
+
NLBarIterCount = "NLBarIterCount"
|
|
276
|
+
PDHGIterCount = "PDHGIterCount"
|
|
277
|
+
FarkasProof = "FarkasProof"
|
|
278
|
+
NumStart = "NumStart"
|
|
279
|
+
TuneResultCount = "TuneResultCount"
|
|
280
|
+
LicenseExpiration = "LicenseExpiration"
|
|
281
|
+
Fingerprint = "Fingerprint"
|
|
282
|
+
ConcurrentWinMethod = "ConcurrentWinMethod"
|
|
283
|
+
MemUsed = "MemUsed"
|
|
284
|
+
MaxMemUsed = "MaxMemUsed"
|
|
285
|
+
|
|
286
|
+
# Variable attributes
|
|
287
|
+
|
|
288
|
+
LB = "LB"
|
|
289
|
+
UB = "UB"
|
|
290
|
+
Obj = "Obj"
|
|
291
|
+
VType = "VType"
|
|
292
|
+
VarName = "VarName"
|
|
293
|
+
X = "X"
|
|
294
|
+
RC = "RC"
|
|
295
|
+
PoolNX = "PoolNX"
|
|
296
|
+
Xn = "Xn"
|
|
297
|
+
BarX = "BarX"
|
|
298
|
+
BarPi = "BarPi"
|
|
299
|
+
Start = "Start"
|
|
300
|
+
VarHintVal = "VarHintVal"
|
|
301
|
+
VarHintPri = "VarHintPri"
|
|
302
|
+
BranchPriority = "BranchPriority"
|
|
303
|
+
Partition = "Partition"
|
|
304
|
+
VBasis = "VBasis"
|
|
305
|
+
PWLObjCvx = "PWLObjCvx"
|
|
306
|
+
PoolIgnore = "PoolIgnore"
|
|
307
|
+
IISLB = "IISLB"
|
|
308
|
+
IISUB = "IISUB"
|
|
309
|
+
IISLBForce = "IISLBForce"
|
|
310
|
+
IISUBForce = "IISUBForce"
|
|
311
|
+
SAObjLow = "SAObjLow"
|
|
312
|
+
SAObjUp = "SAObjUp"
|
|
313
|
+
SALBLow = "SALBLow"
|
|
314
|
+
SALBUp = "SALBUp"
|
|
315
|
+
SAUBLow = "SAUBLow"
|
|
316
|
+
SAUBUp = "SAUBUp"
|
|
317
|
+
UnbdRay = "UnbdRay"
|
|
318
|
+
PStart = "PStart"
|
|
319
|
+
PreFixVal = "PreFixVal"
|
|
320
|
+
VarPreStat = "VarPreStat"
|
|
321
|
+
VTag = "VTag"
|
|
322
|
+
|
|
323
|
+
# Constraint attributes
|
|
324
|
+
|
|
325
|
+
Sense = "Sense"
|
|
326
|
+
RHS = "RHS"
|
|
327
|
+
ConstrName = "ConstrName"
|
|
328
|
+
Pi = "Pi"
|
|
329
|
+
Slack = "Slack"
|
|
330
|
+
CBasis = "CBasis"
|
|
331
|
+
IISConstr = "IISConstr"
|
|
332
|
+
IISConstrForce = "IISConstrForce"
|
|
333
|
+
SARHSLow = "SARHSLow"
|
|
334
|
+
SARHSUp = "SARHSUp"
|
|
335
|
+
FarkasDual = "FarkasDual"
|
|
336
|
+
DStart = "DStart"
|
|
337
|
+
Lazy = "Lazy"
|
|
338
|
+
CTag = "CTag"
|
|
339
|
+
|
|
340
|
+
# SOS attributes
|
|
341
|
+
|
|
342
|
+
IISSOS = "IISSOS"
|
|
343
|
+
IISSOSForce = "IISSOSForce"
|
|
344
|
+
|
|
345
|
+
# Quadratic constraint attributes
|
|
346
|
+
|
|
347
|
+
QCSense = "QCSense"
|
|
348
|
+
QCRHS = "QCRHS"
|
|
349
|
+
QCName = "QCName"
|
|
350
|
+
IISQConstr = "IISQConstr"
|
|
351
|
+
IISQConstrForce = "IISQConstrForce"
|
|
352
|
+
QCPi = "QCPi"
|
|
353
|
+
QCSlack = "QCSlack"
|
|
354
|
+
QCTag = "QCTag"
|
|
355
|
+
|
|
356
|
+
# General constraint attributes
|
|
357
|
+
|
|
358
|
+
GenConstrType = "GenConstrType"
|
|
359
|
+
GenConstrName = "GenConstrName"
|
|
360
|
+
IISGenConstr = "IISGenConstr"
|
|
361
|
+
IISGenConstrForce = "IISGenConstrForce"
|
|
362
|
+
|
|
363
|
+
# General constraint attributes for functions
|
|
364
|
+
|
|
365
|
+
FuncPieceError = "FuncPieceError"
|
|
366
|
+
FuncPieceLength = "FuncPieceLength"
|
|
367
|
+
FuncPieceRatio = "FuncPieceRatio"
|
|
368
|
+
FuncPieces = "FuncPieces"
|
|
369
|
+
FuncNonlinear = "FuncNonlinear"
|
|
370
|
+
|
|
371
|
+
# Quality attributes
|
|
372
|
+
|
|
373
|
+
MaxVio = "MaxVio"
|
|
374
|
+
|
|
375
|
+
BoundVio = "BoundVio"
|
|
376
|
+
BoundSVio = "BoundSVio"
|
|
377
|
+
BoundVioIndex = "BoundVioIndex"
|
|
378
|
+
BoundSVioIndex = "BoundSVioIndex"
|
|
379
|
+
|
|
380
|
+
BoundVioSum = "BoundVioSum"
|
|
381
|
+
BoundSVioSum = "BoundSVioSum"
|
|
382
|
+
|
|
383
|
+
ConstrVio = "ConstrVio"
|
|
384
|
+
ConstrSVio = "ConstrSVio"
|
|
385
|
+
ConstrVioIndex = "ConstrVioIndex"
|
|
386
|
+
ConstrSVioIndex = "ConstrSVioIndex"
|
|
387
|
+
|
|
388
|
+
ConstrVioSum = "ConstrVioSum"
|
|
389
|
+
ConstrSVioSum = "ConstrSVioSum"
|
|
390
|
+
|
|
391
|
+
ConstrResidual = "ConstrResidual"
|
|
392
|
+
ConstrSResidual = "ConstrSResidual"
|
|
393
|
+
ConstrResidualIndex = "ConstrResidualIndex"
|
|
394
|
+
ConstrSResidualIndex = "ConstrSResidualIndex"
|
|
395
|
+
|
|
396
|
+
ConstrResidualSum = "ConstrResidualSum"
|
|
397
|
+
ConstrSResidualSum = "ConstrSResidualSum"
|
|
398
|
+
|
|
399
|
+
DualVio = "DualVio"
|
|
400
|
+
DualSVio = "DualSVio"
|
|
401
|
+
DualVioIndex = "DualVioIndex"
|
|
402
|
+
DualSVioIndex = "DualSVioIndex"
|
|
403
|
+
|
|
404
|
+
DualVioSum = "DualVioSum"
|
|
405
|
+
DualSVioSum = "DualSVioSum"
|
|
406
|
+
|
|
407
|
+
DualResidual = "DualResidual"
|
|
408
|
+
DualSResidual = "DualSResidual"
|
|
409
|
+
DualResidualIndex = "DualResidualIndex"
|
|
410
|
+
DualSResidualIndex = "DualSResidualIndex"
|
|
411
|
+
|
|
412
|
+
DualResidualSum = "DualResidualSum"
|
|
413
|
+
DualSResidualSum = "DualSResidualSum"
|
|
414
|
+
|
|
415
|
+
ComplVio = "ComplVio"
|
|
416
|
+
ComplVioIndex = "ComplVioIndex"
|
|
417
|
+
ComplVioSum = "ComplVioSum"
|
|
418
|
+
|
|
419
|
+
IntVio = "IntVio"
|
|
420
|
+
IntVioIndex = "IntVioIndex"
|
|
421
|
+
IntVioSum = "IntVioSum"
|
|
422
|
+
|
|
423
|
+
# Solution pool quality attributes
|
|
424
|
+
|
|
425
|
+
PoolNMaxVio = "PoolNMaxVio"
|
|
426
|
+
PoolNBoundVio = "PoolNBoundVio"
|
|
427
|
+
PoolNBoundVioIndex = "PoolNBoundVioIndex"
|
|
428
|
+
PoolNBoundVioSum = "PoolNBoundVioSum"
|
|
429
|
+
PoolNConstrVio = "PoolNConstrVio"
|
|
430
|
+
PoolNConstrVioIndex = "PoolNConstrVioIndex"
|
|
431
|
+
PoolNConstrVioSum = "PoolNConstrVioSum"
|
|
432
|
+
PoolNIntVio = "PoolNIntVio"
|
|
433
|
+
PoolNIntVioIndex = "PoolNIntVioIndex"
|
|
434
|
+
PoolNIntVioSum = "PoolNIntVioSum"
|
|
435
|
+
|
|
436
|
+
# Multi-objective attributes
|
|
437
|
+
|
|
438
|
+
ObjN = "ObjN"
|
|
439
|
+
ObjNCon = "ObjNCon"
|
|
440
|
+
ObjNPriority = "ObjNPriority"
|
|
441
|
+
ObjNWeight = "ObjNWeight"
|
|
442
|
+
ObjNRelTol = "ObjNRelTol"
|
|
443
|
+
ObjNAbsTol = "ObjNAbsTol"
|
|
444
|
+
ObjNVal = "ObjNVal"
|
|
445
|
+
ObjNName = "ObjNName"
|
|
446
|
+
NumObj = "NumObj"
|
|
447
|
+
|
|
448
|
+
NumObjPasses = "NumObjPasses"
|
|
449
|
+
ObjNPass = "ObjNPass"
|
|
450
|
+
ObjNPassIterCount = "ObjNPassIterCount"
|
|
451
|
+
ObjNPassMIPGap = "ObjNPassMIPGap"
|
|
452
|
+
ObjNPassNodeCount = "ObjNPassNodeCount"
|
|
453
|
+
ObjNPassObjBound = "ObjNPassObjBound"
|
|
454
|
+
ObjNPassObjVal = "ObjNPassObjVal"
|
|
455
|
+
ObjNPassOpenNodeCount = "ObjNPassOpenNodeCount"
|
|
456
|
+
ObjNPassRuntime = "ObjNPassRuntime"
|
|
457
|
+
ObjNPassStatus = "ObjNPassStatus"
|
|
458
|
+
ObjNPassWork = "ObjNPassWork"
|
|
459
|
+
|
|
460
|
+
# Multi-scenario attributes
|
|
461
|
+
|
|
462
|
+
ScenNLB = "ScenNLB"
|
|
463
|
+
ScenNUB = "ScenNUB"
|
|
464
|
+
ScenNObj = "ScenNObj"
|
|
465
|
+
ScenNRHS = "ScenNRHS"
|
|
466
|
+
ScenNName = "ScenNName"
|
|
467
|
+
ScenNX = "ScenNX"
|
|
468
|
+
ScenNObjBound = "ScenNObjBound"
|
|
469
|
+
ScenNObjVal = "ScenNObjVal"
|
|
470
|
+
NumScenarios = "NumScenarios"
|
|
471
|
+
|
|
472
|
+
# Batch attributes
|
|
473
|
+
|
|
474
|
+
BatchErrorCode = "BatchErrorCode"
|
|
475
|
+
BatchErrorMessage = "BatchErrorMessage"
|
|
476
|
+
BatchID = "BatchID"
|
|
477
|
+
BatchStatus = "BatchStatus"
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Wrapper for 'GRB.Callback' object
|
|
2
|
+
|
|
3
|
+
class CallbackConstClass(object):
|
|
4
|
+
'''
|
|
5
|
+
Callbacks are user methods that are called by the Gurobi solver
|
|
6
|
+
during the optimization. To use a callback, define a method
|
|
7
|
+
that takes two integer arguments (model and where), and pass it
|
|
8
|
+
as the argument to Model.optimize. Once optimization begins,
|
|
9
|
+
your method will be called with one of the following 'where' values:
|
|
10
|
+
|
|
11
|
+
Possible 'where' values (e.g., where == GRB.Callback.MIP) are:
|
|
12
|
+
|
|
13
|
+
POLLING: Regular polling callback - no user queries allowed
|
|
14
|
+
PRESOLVE: In presolve
|
|
15
|
+
SIMPLEX: In simplex
|
|
16
|
+
BARRIER: In barrier
|
|
17
|
+
MIP: In MIP
|
|
18
|
+
MIPSOL: New MIP incumbent available
|
|
19
|
+
MIPNODE: MIP node information available
|
|
20
|
+
MULTIOBJ: In multi-objective optimization
|
|
21
|
+
IIS: In IIS computation
|
|
22
|
+
NLBAR: In NL barrier
|
|
23
|
+
MESSAGE: Optimizer output a message
|
|
24
|
+
|
|
25
|
+
Your method can call Model.cbGet() to obtain detailed information
|
|
26
|
+
on the progress of the optimization. Allowed values depend
|
|
27
|
+
on 'where'. The prefix of the 'what' name indicate which
|
|
28
|
+
ones are allowed for each 'where' (so 'PRE_COLDEL' can only
|
|
29
|
+
be called when where == SIMPLEX).
|
|
30
|
+
|
|
31
|
+
Allowed 'what' values (e.g., cbGet(GRB.Callback.MIP_OBJBND)) are:
|
|
32
|
+
|
|
33
|
+
RUNTIME: Elapsed solver runtime
|
|
34
|
+
WORK: Elapsed solver work
|
|
35
|
+
MEMUSED: Current size of allocated memory (in GB)
|
|
36
|
+
MAXMEMUSED: Maximum size of allocated memory (in GB)
|
|
37
|
+
PRE_COLDEL: Deleted column count
|
|
38
|
+
PRE_ROWDEL: Deleted row count
|
|
39
|
+
PRE_SENCHG: Changed constraint sense count
|
|
40
|
+
PRE_BNDCHG: Bound change count
|
|
41
|
+
SPX_ITRCNT: Iteration count
|
|
42
|
+
SPX_OBJVAL: Primal objective value
|
|
43
|
+
SPX_PRIMINF: Primal infeasibility
|
|
44
|
+
SPX_DUALINF: Dual infeasibility
|
|
45
|
+
SPX_ISPERT: Has model been perturbed?
|
|
46
|
+
BARRIER_ITRCNT: Barrier iteration count
|
|
47
|
+
BARRIER_PRIMOBJ: Barrier iterate primal objective
|
|
48
|
+
BARRIER_DUALOBJ: Barrier iterate dual objective
|
|
49
|
+
BARRIER_PRIMINF: Barrier iterate primal infeasibility
|
|
50
|
+
BARRIER_DUALINF: Barrier iterate dual infeasibility
|
|
51
|
+
BARRIER_COMPL: Barrier iterate complementarity violation
|
|
52
|
+
MIP_OBJBST: Best known objective bound
|
|
53
|
+
MIP_OBJBND: Best known feasible objective
|
|
54
|
+
MIP_NODCNT: Nodes explored so far
|
|
55
|
+
MIP_SOLCNT: Solutions found so far
|
|
56
|
+
MIP_CUTCNT: Cuts added to the model so far
|
|
57
|
+
MIP_NODLFT: Unexplored nodes
|
|
58
|
+
MIP_ITRCNT: Simplex iterations performed so far
|
|
59
|
+
MIP_OPENSCENARIOS: Number of scenarios that are still open in a multi-scenario model
|
|
60
|
+
MIP_PHASE: Solution phase
|
|
61
|
+
MIPSOL_SOL: Feasible solution (a vector)
|
|
62
|
+
MIPSOL_OBJ: Objective value for feasible solution
|
|
63
|
+
MIPSOL_OBJBST: Best known objective bound
|
|
64
|
+
MIPSOL_OBJBND: Best known feasible objective
|
|
65
|
+
MIPSOL_NODCNT: Node count for feasible solution
|
|
66
|
+
MIPSOL_SOLCNT: Solutions found so far
|
|
67
|
+
MIPSOL_OPENSCENARIOS: Number of scenarios that are still open in a multi-scenario model
|
|
68
|
+
MIPSOL_PHASE: Solution phase
|
|
69
|
+
MIPNODE_STATUS: Optimization status of node relaxation
|
|
70
|
+
MIPNODE_REL: Node relaxation solution or ray if unbounded
|
|
71
|
+
MIPNODE_OBJBST: Best known objective bound
|
|
72
|
+
MIPNODE_OBJBND: Best known feasible objective
|
|
73
|
+
MIPNODE_NODCNT: Nodes explored so far
|
|
74
|
+
MIPNODE_SOLCNT: Solutions found so far
|
|
75
|
+
MIPNODE_SBRVAR: Node branching variable
|
|
76
|
+
MIPNODE_OPENSCENARIOS: Number of scenarios that are still open in a multi-scenario model
|
|
77
|
+
MIPNODE_PHASE: Solution phase
|
|
78
|
+
MULTIOBJ_OBJCNT: Objective count optimized so far
|
|
79
|
+
MULTIOBJ_SOLCNT: Solutions found so far
|
|
80
|
+
MULTIOBJ_SOL: Feasible solution (a vector)
|
|
81
|
+
MULTIOBJ_ITRCNT: Iteration count of last single objective solve
|
|
82
|
+
MULTIOBJ_OBJBST: Objective value of best solution of last objective solve
|
|
83
|
+
MULTIOBJ_OBJBND: Dual bound of last objective solve
|
|
84
|
+
MULTIOBJ_STATUS: Status of last objective solve
|
|
85
|
+
MULTIOBJ_MIPGAP: MIP gap of last single objective solve
|
|
86
|
+
MULTIOBJ_NODCNT: node count of last objective solve
|
|
87
|
+
MULTIOBJ_NODLFT: open node count of last objective solve
|
|
88
|
+
MULTIOBJ_RUNTIME: runtime of last single objective solve
|
|
89
|
+
MULTIOBJ_WORK: work of last objective solve
|
|
90
|
+
IIS_CONSTRMIN: Minimum number of constraints in IIS
|
|
91
|
+
IIS_CONSTRMAX: Maximum number of constraints in IIS
|
|
92
|
+
IIS_CONSTRGUESS: Estimated number of constraints in IIS
|
|
93
|
+
IIS_BOUNDMIN: Minimum number of bounds in IIS
|
|
94
|
+
IIS_BOUNDMAX: Maximum number of bounds in IIS
|
|
95
|
+
IIS_BOUNDGUESS: Estimated number of bounds in IIS
|
|
96
|
+
NLBAR_ITRCNT: NL barrier iteration count
|
|
97
|
+
NLBAR_PRIMOBJ: NL barrier iterate primal objective
|
|
98
|
+
NLBAR_PRIMINF: NL barrier iterate primal infeasibility
|
|
99
|
+
NLBAR_DUALINF: NL barrier iterate dual infeasibility
|
|
100
|
+
NLBAR_COMPL: NL barrier iterate complementarity violation
|
|
101
|
+
MSG_STRING: Output message
|
|
102
|
+
|
|
103
|
+
Your callback method can call other methods on the model object:
|
|
104
|
+
cbCut(), cbGet(), cbGetNodeRel(), cbGetSolution(), cbSetSolution()
|
|
105
|
+
'''
|
|
106
|
+
|
|
107
|
+
def __setattr__(self, name, value):
|
|
108
|
+
raise AttributeError("Gurobi callback constants are not modifiable")
|
|
109
|
+
|
|
110
|
+
# Callbacks
|
|
111
|
+
|
|
112
|
+
POLLING = 0
|
|
113
|
+
PRESOLVE = 1
|
|
114
|
+
SIMPLEX = 2
|
|
115
|
+
MIP = 3
|
|
116
|
+
MIPSOL = 4
|
|
117
|
+
MIPNODE = 5
|
|
118
|
+
MESSAGE = 6
|
|
119
|
+
BARRIER = 7
|
|
120
|
+
MULTIOBJ = 8
|
|
121
|
+
IIS = 9
|
|
122
|
+
PDHG = 10
|
|
123
|
+
NLBAR = 11
|
|
124
|
+
|
|
125
|
+
PRE_COLDEL = 1000
|
|
126
|
+
PRE_ROWDEL = 1001
|
|
127
|
+
PRE_SENCHG = 1002
|
|
128
|
+
PRE_BNDCHG = 1003
|
|
129
|
+
PRE_COECHG = 1004
|
|
130
|
+
SPX_ITRCNT = 2000
|
|
131
|
+
SPX_OBJVAL = 2001
|
|
132
|
+
SPX_PRIMINF = 2002
|
|
133
|
+
SPX_DUALINF = 2003
|
|
134
|
+
SPX_ISPERT = 2004
|
|
135
|
+
|
|
136
|
+
BARRIER_ITRCNT = 7001
|
|
137
|
+
BARRIER_PRIMOBJ = 7002
|
|
138
|
+
BARRIER_DUALOBJ = 7003
|
|
139
|
+
BARRIER_PRIMINF = 7004
|
|
140
|
+
BARRIER_DUALINF = 7005
|
|
141
|
+
BARRIER_COMPL = 7006
|
|
142
|
+
|
|
143
|
+
MIP_OBJBST = 3000
|
|
144
|
+
MIP_OBJBND = 3001
|
|
145
|
+
MIP_NODCNT = 3002
|
|
146
|
+
MIP_SOLCNT = 3003
|
|
147
|
+
MIP_CUTCNT = 3004
|
|
148
|
+
MIP_NODLFT = 3005
|
|
149
|
+
MIP_ITRCNT = 3006
|
|
150
|
+
MIP_OPENSCENARIOS = 3007
|
|
151
|
+
MIP_PHASE = 3008
|
|
152
|
+
MIPSOL_SOL = 4001
|
|
153
|
+
MIPSOL_OBJ = 4002
|
|
154
|
+
MIPSOL_OBJBST = 4003
|
|
155
|
+
MIPSOL_OBJBND = 4004
|
|
156
|
+
MIPSOL_NODCNT = 4005
|
|
157
|
+
MIPSOL_SOLCNT = 4006
|
|
158
|
+
MIPSOL_OPENSCENARIOS = 4007
|
|
159
|
+
MIPSOL_PHASE = 4008
|
|
160
|
+
MIPNODE_STATUS = 5001
|
|
161
|
+
MIPNODE_REL = 5002
|
|
162
|
+
MIPNODE_OBJBST = 5003
|
|
163
|
+
MIPNODE_OBJBND = 5004
|
|
164
|
+
MIPNODE_NODCNT = 5005
|
|
165
|
+
MIPNODE_SOLCNT = 5006
|
|
166
|
+
MIPNODE_BRVAR = 5007
|
|
167
|
+
MIPNODE_OPENSCENARIOS = 5008
|
|
168
|
+
MIPNODE_PHASE = 5009
|
|
169
|
+
MSG_STRING = 6001
|
|
170
|
+
RUNTIME = 6002
|
|
171
|
+
WORK = 6003
|
|
172
|
+
MEMUSED = 6004
|
|
173
|
+
MAXMEMUSED = 6005
|
|
174
|
+
|
|
175
|
+
MULTIOBJ_OBJCNT = 8001
|
|
176
|
+
MULTIOBJ_SOLCNT = 8002
|
|
177
|
+
MULTIOBJ_SOL = 8003
|
|
178
|
+
MULTIOBJ_ITRCNT = 8004
|
|
179
|
+
MULTIOBJ_OBJBST = 8005
|
|
180
|
+
MULTIOBJ_OBJBND = 8006
|
|
181
|
+
MULTIOBJ_STATUS = 8007
|
|
182
|
+
MULTIOBJ_MIPGAP = 8008
|
|
183
|
+
MULTIOBJ_NODCNT = 8009
|
|
184
|
+
MULTIOBJ_NODLFT = 8010
|
|
185
|
+
MULTIOBJ_RUNTIME = 8011
|
|
186
|
+
MULTIOBJ_WORK = 8012
|
|
187
|
+
|
|
188
|
+
IIS_CONSTRMIN = 9001
|
|
189
|
+
IIS_CONSTRMAX = 9002
|
|
190
|
+
IIS_CONSTRGUESS = 9003
|
|
191
|
+
IIS_BOUNDMIN = 9004
|
|
192
|
+
IIS_BOUNDMAX = 9005
|
|
193
|
+
IIS_BOUNDGUESS = 9006
|
|
194
|
+
|
|
195
|
+
PDHG_ITRCNT = 10001
|
|
196
|
+
PDHG_PRIMOBJ = 10002
|
|
197
|
+
PDHG_DUALOBJ = 10003
|
|
198
|
+
PDHG_PRIMINF = 10004
|
|
199
|
+
PDHG_DUALINF = 10005
|
|
200
|
+
PDHG_COMPL = 10006
|
|
201
|
+
|
|
202
|
+
NLBAR_ITRCNT = 11001
|
|
203
|
+
NLBAR_PRIMOBJ = 11002
|
|
204
|
+
NLBAR_PRIMINF = 11003
|
|
205
|
+
NLBAR_DUALINF = 11004
|
|
206
|
+
NLBAR_COMPL = 11005
|
|
Binary file
|