添加链接
注册
登录
link管理
链接快照平台
输入网页链接,自动生成快照
标签化管理网页链接
相关文章推荐
挂过科的打火机
·
pthread 简要使用指南(三) ...
·
2 月前
·
沉稳的紫菜汤
·
Flink ...
·
2 月前
·
小胡子的围巾
·
CSS button 按钮大小设置三种方法 ...
·
3 月前
·
沉稳的萝卜
·
JSX:循环与数组渲染 · fuck-react
·
3 月前
·
眉毛粗的木瓜
·
2020合肥新站高新区初中学区划分图一览- ...
·
5 月前
·
link管理
›
gurobi-stubs/gurobipy_vscode.pyi at master · katrinafyi/gurobi-stubs · GitHub
https://github.com/katrinafyi/gurobi-stubs/blob/master/gurobipy_vscode.pyi
爱玩的遥控器
5 月前
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Files
master
Breadcrumbs
gurobi-stubs
/
gurobipy_vscode.pyi
Blame
Blame
Latest commit
History
History
4945 lines (4331 loc) · 128 KB
master
Breadcrumbs
gurobi-stubs
/
gurobipy_vscode.pyi
Top
File metadata and controls
Code
Blame
4945 lines (4331 loc) · 128 KB
Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from
typing
import
Any
from
io
import
TextIOBase
as
_TextIOBase
class
LinExpr
(
object
):
def
__repr__
(
self
):
"""
Return repr(self).
"""
...
def
__lt__
(
self
,
value
):
"""
Return self<value.
"""
...
def
__le__
(
self
,
value
):
"""
Return self<=value.
"""
...
def
__eq__
(
self
,
value
):
"""
Return self==value.
"""
...
def
__ne__
(
self
,
value
):
"""
Return self!=value.
"""
...
def
__gt__
(
self
,
value
):
"""
Return self>value.
"""
...
def
__ge__
(
self
,
value
):
"""
Return self>=value.
"""
...
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""
Initialize self. See help(type(self)) for accurate signature.
"""
...
def
__add__
(
self
,
value
):
"""
Return self+value.
"""
...
def
__radd__
(
self
,
value
):
"""
Return value+self.
"""
...
def
__sub__
(
self
,
value
):
"""
Return self-value.
"""
...
def
__rsub__
(
self
,
value
):
"""
Return value-self.
"""
...
def
__mul__
(
self
,
value
):
"""
Return self*value.
"""
...
def
__rmul__
(
self
,
value
):
"""
Return value*self.
"""
...
def
__neg__
(
self
):
"""
-self
"""
...
def
__iadd__
(
self
,
value
):
"""
Return self+=value.
"""
...
def
__isub__
(
self
,
value
):
"""
Return self-=value.
"""
...
def
__imul__
(
self
,
value
):
"""
Return self*=value.
"""
...
def
__truediv__
(
self
,
value
):
"""
Return self/value.
"""
...
def
__rtruediv__
(
self
,
value
):
"""
Return value/self.
"""
...
def
__new__
(
*
args
,
**
kwargs
):
"""
Create and return a new object. See help(type) for accurate signature.
"""
...
def
_flatten
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
_normalize
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
add
(
self
,
expr
,
mult
=
1.0
):
"""
ROUTINE:
add(expr, mult=1.0)
PURPOSE:
Add a linear multiple of one expression into another.
ARGUMENTS:
expr (LinExpr): The expression to add
mult (float): The linear multiplier
EXAMPLE:
expr1.add(expr2, 2.0)
"""
...
def
addConstant
(
self
,
constant
):
"""
ROUTINE:
addConstant(constant)
PURPOSE:
Add a constant into a linear expression.
ARGUMENTS:
constant (float): The value to add
EXAMPLE:
expr.addConstant(3.5)
"""
...
def
addTerms
(
self
,
coeffs
,
vars
):
"""
ROUTINE:
addTerms(coeffs, vars)
PURPOSE:
Add a list of terms into a linear expression.
ARGUMENTS:
coeffs (list of float): The coefficients for the new terms
vars (list of Var): The variables for the new terms
EXAMPLE:
expr.addTerms(1.0, x)
expr.addTerms([1.0, 2.0], [x, y])
"""
...
def
_mul
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
size
(
self
):
"""
ROUTINE:
size()
PURPOSE:
Return the number of terms in a linear expression.
ARGUMENTS:
None.
RETURN VALUE:
Number of terms in expression.
EXAMPLE:
print expr.size()
"""
...
def
getConstant
(
self
):
"""
ROUTINE:
getConstant()
PURPOSE:
Return the constant terms from a linear expression.
ARGUMENTS:
None.
RETURN VALUE:
Constant for expression.
EXAMPLE:
print expr.getConstant()
"""
...
def
getCoeff
(
self
,
i
):
"""
ROUTINE:
getCoeff(i)
PURPOSE:
Return the coefficient for the term at index 'i'.
ARGUMENTS:
i (Int): Index of term whose coefficient is requested
RETURN VALUE:
The requested coefficient.
EXAMPLE:
print expr.getCoeff(i)
"""
...
def
getVar
(
self
,
i
):
"""
ROUTINE:
getVar(i)
PURPOSE:
Return the variable for the term at index 'i'.
ARGUMENTS:
i (Int): Index of term whose variable is requested
RETURN VALUE:
The requested variable (a Var object).
EXAMPLE:
print expr.getVar(i)
"""
...
def
getValue
(
self
):
"""
ROUTINE:
getValue()
PURPOSE:
Compute the value of the expression, using the current solution.
ARGUMENTS:
None.
RETURN VALUE:
The computed expression value.
EXAMPLE:
print model.getObjective().getValue()
"""
...
def
remove
(
self
,
which
):
"""
ROUTINE:
remove(which)
PURPOSE:
Remove a term from the expression.
ARGUMENTS:
which: Term to remove. Can be an Int, in which case the term at
index 'which' is removed, or a Var, in which case all terms that
involve the Var 'which' are removed.
EXAMPLE:
print expr.remove(i)
"""
...
def
clear
(
self
):
"""
ROUTINE:
clear()
PURPOSE:
Set a linear expression to zero.
EXAMPLE:
print expr.clear()
"""
...
def
copy
(
self
):
"""
ROUTINE:
copy()
PURPOSE:
Copy a linear expression.
EXAMPLE:
expr2 = expr1.copy()
"""
...
def
__reduce__
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
__setstate__
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
class
QuadExpr
(
object
):
def
__repr__
(
self
):
"""
Return repr(self).
"""
...
def
__lt__
(
self
,
value
):
"""
Return self<value.
"""
...
def
__le__
(
self
,
value
):
"""
Return self<=value.
"""
...
def
__eq__
(
self
,
value
):
"""
Return self==value.
"""
...
def
__ne__
(
self
,
value
):
"""
Return self!=value.
"""
...
def
__gt__
(
self
,
value
):
"""
Return self>value.
"""
...
def
__ge__
(
self
,
value
):
"""
Return self>=value.
"""
...
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""
Initialize self. See help(type(self)) for accurate signature.
"""
...
def
__add__
(
self
,
value
):
"""
Return self+value.
"""
...
def
__radd__
(
self
,
value
):
"""
Return value+self.
"""
...
def
__sub__
(
self
,
value
):
"""
Return self-value.
"""
...
def
__rsub__
(
self
,
value
):
"""
Return value-self.
"""
...
def
__mul__
(
self
,
value
):
"""
Return self*value.
"""
...
def
__rmul__
(
self
,
value
):
"""
Return value*self.
"""
...
def
__neg__
(
self
):
"""
-self
"""
...
def
__iadd__
(
self
,
value
):
"""
Return self+=value.
"""
...
def
__isub__
(
self
,
value
):
"""
Return self-=value.
"""
...
def
__imul__
(
self
,
value
):
"""
Return self*=value.
"""
...
def
__truediv__
(
self
,
value
):
"""
Return self/value.
"""
...
def
__rtruediv__
(
self
,
value
):
"""
Return value/self.
"""
...
def
__new__
(
*
args
,
**
kwargs
):
"""
Create and return a new object. See help(type) for accurate signature.
"""
...
def
_flatten
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
_normalize
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
add
(
self
,
expr
,
mult
=
1.0
):
"""
ROUTINE:
add(expr, mult=1.0)
PURPOSE:
Add a linear multiple of one expression into another.
ARGUMENTS:
expr (LinExpr or QuadExpr): The expression to add
mult (float): The linear multiplier
EXAMPLE:
expr1.add(expr2, 2.0)
"""
...
def
addConstant
(
self
,
constant
):
"""
ROUTINE:
addConstant(constant)
PURPOSE:
Add a constant into a quadratic expression.
ARGUMENTS:
constant (float): The value to add
EXAMPLE:
expr.addConstant(3.5)
"""
...
def
addTerms
(
self
,
coeffs
,
vars
):
"""
ROUTINE:
addTerms(coeffs, vars)
addTerms(coeffs, vars, vars2)
PURPOSE:
Add a list of terms, either linear or quadratic, into a quadratic
expression.
ARGUMENTS:
coeffs (list of float): The coefficients for the new terms
vars (list of Var): The variables for the new terms
vars2 (list of Var): The variables for the new terms
EXAMPLE:
expr.addTerms(1.0, x)
expr.addTerms(1.0, x, x)
expr.addTerms([1.0, 2.0], [x, y])
expr.addTerms([1.0, 2.0], [x, y], [x, y])
"""
...
def
_mul
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
size
(
self
):
"""
ROUTINE:
size()
PURPOSE:
Return the number of quadratic terms in a quadratic expression.
ARGUMENTS:
None.
RETURN VALUE:
Number of terms in expression.
EXAMPLE:
print expr.size()
"""
...
def
getLinExpr
(
self
):
"""
ROUTINE:
getLinExpr()
PURPOSE:
Return the linear portion of a quadration expression (as a LinExpr
object).
ARGUMENTS:
None.
RETURN VALUE:
Linear expression.
EXAMPLE:
print expr.getLinExpr()
"""
...
def
getCoeff
(
self
,
i
):
"""
ROUTINE:
getCoeff(i)
PURPOSE:
Return the coefficient for the term at index 'i'.
ARGUMENTS:
i (Int): Index of term whose coefficient is requested
RETURN VALUE:
The requested coefficient.
EXAMPLE:
print expr.getCoeff(i)
"""
...
def
getVar1
(
self
,
i
):
"""
ROUTINE:
getVar1(i)
PURPOSE:
Return the first variable for the quadratic term at index 'i'.
ARGUMENTS:
i (Int): Index of quadratic term whose variable is requested
RETURN VALUE:
The requested variable.
EXAMPLE:
print expr.getVar1(i)
"""
...
def
getVar2
(
self
,
i
):
"""
ROUTINE:
getVar2(i)
PURPOSE:
Return the second variable for the quadratic term at index 'i'.
ARGUMENTS:
i (Int): Index of quadratic term whose variable is requested
RETURN VALUE:
The requested variable.
EXAMPLE:
print expr.getVar2(i)
"""
...
def
getValue
(
self
):
"""
ROUTINE:
getValue()
PURPOSE:
Compute the value of the expression, using the current solution.
ARGUMENTS:
None.
RETURN VALUE:
The computed expression value.
EXAMPLE:
print model.getObjective().getValue()
"""
...
def
remove
(
self
,
which
):
"""
ROUTINE:
remove(which)
PURPOSE:
Remove a quadratic term from the expression.
ARGUMENTS:
which: Term to remove. Can be an Int, in which case the quadratic term
at index 'which' is removed, or a Var, in which case all quadratic
terms that involve the Var 'which' are removed.
EXAMPLE:
print expr.remove(i)
"""
...
def
clear
(
self
):
"""
ROUTINE:
clear()
PURPOSE:
Set a linear expression to zero.
EXAMPLE:
print expr.clear()
"""
...
def
copy
(
self
):
"""
ROUTINE:
copy()
PURPOSE:
Copy a quadratic expression.
EXAMPLE:
expr2 = expr1.copy()
"""
...
def
__reduce__
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
def
__setstate__
(
self
,
*
args
,
**
kwargs
)
->
Any
:
...
class
Env
(
object
):
"""
Gurobi environment object. Methods on this object are:
readParams(paramname): Read a set of parameter settings from a file.
resetParams(): Reset all parameters to their default values.
setParam(paramname, newval): Set a parameter to a new value.
writeParams(paramname): Write the current parameter settings to a file.
Additional help can be obtained on any of these methods (e.g.,
help(Env.setParam)). A list of all available parameters can be
obtained by typing 'help(GRB.param)'.
"""
_default
:
bool
=
...
_user
:
bool
=
...
_modcnt
:
int
=
...
def
__init__
(
self
,
logfilename
=
''
,
empty
=
False
,
cenv
=
None
,
isDefault
=
False
):
...
def
__del__
(
self
):
...
def
__repr__
(
self
):
...
def
_paramlist
(
self
,
paramname
):
...
def
_message
(
self
,
msg
):
...
def
_getParamInfo
(
self
,
paramname
):
...
def
_Env__setone
(
self
,
paraminfo
,
newval
):
...
def
setParam
(
self
,
paramname
,
newval
,
verbose
=
True
):
"""
ROUTINE:
setParam(paramname, newvalue)
PURPOSE:
Set a parameter to a new value.
ARGUMENTS:
paramname (string): The name of the parameter.
newvalue: The desired new value. The type of the value should be
compatible with the parameter type (e.g., an integer parameter
will take an integer value). One important exception: the
string "default" will return the specified parameter to its
default value.
RETURN VALUE:
None.
EXAMPLE:
env.setParam("NodeLimit", 100)
env.setParam("TimeLimit", "default")
NOTES:
Use this routine to change parameter values in the default environment.
The default environment is used to initialize parameter values when a
new model is created. Once the model exists, changes to the default
environment will no longer affect that model. Use Model.setParam()
to change parameter settings for an existing model.
Routine paramHelp() provides additional information on the available
parameters.
"""
...
def
resetParams
(
self
):
"""
ROUTINE:
resetParams()
PURPOSE:
Reset all parameters to their default values.
ARGUMENTS:
None.
RETURN VALUE:
None.
EXAMPLE:
env.resetParams()
NOTES:
This routine should normally be called on the default environment or on
a model object.
"""
...
def
readParams
(
self
,
filename
):
"""
ROUTINE:
readParams(filename)
PURPOSE:
Read a set of parameter settings from a file.
ARGUMENTS:
filename (string): A path to a file containing a list of parameter
settings.
RETURN VALUE:
None.
EXAMPLE:
env.readParams('gurobi.prm')
NOTES:
This routine should normally be called on the default environment or on
a model object.
The parameter file should contain "name value" pairs, each on its own
line. A hash symbol at the beginning of a line indicates that the line
should be ignored. Here is an example of a valid parameter file:
# List of changed parameters
TimeLimit 100
IterationLimit 1000
"""
...
def
writeParams
(
self
,
filename
):
"""
ROUTINE:
writeParams(filename)
PURPOSE:
Write non-default parameter settings to a file.
ARGUMENTS:
filename (string): The name of the file to which non-default parameter
settings should be written.
RETURN VALUE:
None.
EXAMPLE:
env.writeParams('changed.prm')
NOTES:
This routine should normally be called on the default environment or on
a model object.
Upon completion, the specified file will contain a set of "name value"
pairs, one per line, that indicates the set of parameters that current
have non-default values in the specified model.
"""
...
def
start
(
self
):
...
def
dispose
(
self
):
...
@
classmethod
def
ClientEnv
(
cls
,
*
args
,
**
kwargs
)
->
Any
:
...
@
classmethod
def
CloudEnv
(
cls
,
*
args
,
**
kwargs
)
->
Any
:
...
@
classmethod
def
OtherEnv
(
cls
,
*
args
,
**
kwargs
)
->
Any
:
...
class
Var
(
object
):
"""
Gurobi variable object. Variables have a number of attributes.
Some can be set (e.g., v.ub = 0.0), while others can only be queried
(e.g., print v.x). The most commonly used variable attributes are:
obj: Linear objective coefficient.
lb: Lower bound.
ub: Upper bound.
varName: Variable name.
vType: Variable type ('C', 'B', 'I', 'S', or 'N').
x: Solution value.
rc: Solution reduced cost.
xn: Solution value in an alternate MIP solution.
Type "help(GRB.attr)" for a list of all available attributes.
Note that attribute modifications are handled in a lazy fashion. You
won't see the effect of a change until after the next call to Model.update()
or Model.optimize().
"""
def
__init__
(
self
,
cmodel
,
colno
):
...
def
__dir__
(
self
):
...
def
__colno__
(
self
):
...
def
__repr__
(
self
):
...
def
__numcols__
(
self
):
...
def
__getattr__
(
self
,
name
):
...
def
__setattr__
(
self
,
name
,
value
):
...
def
getAttr
(
self
,
attrname
):
"""
ROUTINE:
getAttr(attrname)
PURPOSE:
Request the value of a variable attribute.
ARGUMENTS:
attrname (string): The name of the requested attribute.
RETURN VALUE:
The attribute value.
EXAMPLE:
print var.getAttr("varName")
NOTES:
Type "help(GRB.attr)" for a list of all available attributes.
"""
...
def
setAttr
(
self
,
attrname
,
newval
):
"""
ROUTINE:
setAttr(attrname, newvalue)
PURPOSE:
Change the value of a variable attribute.
ARGUMENTS:
attrname (string): The name of the attribute.
newvalue: The desired new value. The type of the value should be
compatible with the attribute type (e.g., an integer parameter
will take an integer value).
RETURN VALUE:
The attribute value.
EXAMPLE:
var.setAttr("varName", "New name")
NOTES:
Constraint attributes that can be set are:
VarName: Name of the variable.
lb: Lower bound.
ub: Upper bound.
obj: Objective coefficient.
vType: Variable type ('C', 'B', 'I', 'S', or 'N').
Attributes changes are handled in a lazy fashion. The effect of a
change isn't visible until after the next call to Model.update() or
Model.optimize().
"""
...
def
sameAs
(
self
,
other
):
"""
ROUTINE:
sameAs(othervar)
PURPOSE:
Indicates whether two variable objects refer to the same Gurobi model
variable. You should use this instead of the '==' operator, since
'==' is used to create linear constraints.
ARGUMENTS:
othervar (Var): The variable to compare against.
RETURN VALUE:
True if both Var objects refer to the same model variable.
EXAMPLE:
var1.sameAs(var2)
"""
...
def
__le__
(
self
,
rhs
):
...
def
__ge__
(
self
,
rhs
):
...
def
__eq__
(
self
,
rhs
):
...
def
__ne__
(
self
,
rhs
):
...
def
__add__
(
self
,
expr
):
...
def
__radd__
(
self
,
expr
):
...
def
__iadd__
(
self
,
expr
):
...
def
__sub__
(
self
,
expr
):
...
def
__rsub__
(
self
,
expr
):
...
def
__isub__
(
self
,
expr
):
...
def
__mul__
(
self
,
expr
):
...
def
__rmul__
(
self
,
expr
):
...
def
__imul__
(
self
,
expr
):
...
def
__div__
(
self
,
constant
):
...
def
__truediv__
(
self
,
constant
):
...
def
__neg__
(
self
):
...
lb
=
...
"""Lower bound"""
ub
=
...
"""Upper bound"""
obj
=
...
"""Objective coefficient"""
vType
=
...
"""Variable type (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER, GRB.SEMICONT, or GRB.SEMIINT)"""
varName
=
...
"""Variable name"""
x
=
...
"""Solution value"""
rc
=
...
"""Reduced cost"""
xn
=
...
"""Solution value in alternate MIP solution"""
start
=
...
"""Start vector (use GRB.UNDEFINED to leave a value unspecified)"""
vBasis
=
...
"""Basis status"""
varHintVal
=
...
"""Variable hint value"""
varHintPri
=
...
"""Variable hint priority"""
branchPriority
=
...
"""Variable branch priority"""
partition
=
...
"""Variable partition"""
IISLB
=
...
"""Does LB participate in IIS? (for infeasible models)"""
IISUB
=
...
"""Does UB participate in IIS? (for infeasible models)"""
SAObjLow
=
...
"""Smallest objective coefficient for which basis remains optimal"""
SAObjUp
=
...
"""Largest objective coefficient for which basis remains optimal"""
SALBLow
=
...
"""Smallest lower bound for which basis remains optimal"""
SALBUp
=
...
"""Largest lower bound for which basis remains optimal"""
SAUBLow
=
...
"""Smallest upper bound for which basis remains optimal"""
SAUBUp
=
...
"""Largest upper bound for which basis remains optimal"""
unbdRay
=
...
"""Unbounded ray"""
pStart
=
...
"""Primal solution (for warm-starting simplex)"""
preFixVal
=
...
"""The value of the variable (for variables fixed by presolve)"""
varPreStat
=
...
"""Status of variable in presolved model"""
class
Constr
(
object
):
"""
Gurobi constraint object. Constraints have a number of attributes.
Some can be set (e.g., c.rhs = 0.0), while others can only be queried
(e.g., print c.pi). The most commonly used constraint attributes are:
sense: Constraint sense ('<', '>', or '=').
rhs: Right-hand side value.
constrName: Constraint name.
pi: Dual value in current solution
slack: Slack in current solution.
Type "help(GRB.attr)" for a list of all available attributes.
Note that attribute modifications are handled in a lazy fashion. You
won't see the effect of a change until after the next call to Model.update()
or Model.optimize().
"""
def
__init__
(
self
,
cmodel
,
rowno
):
...
def
__dir__
(
self
):
...
def
__rowno__
(
self
):
...
def
__repr__
(
self
):
...
def
__numrows__
(
self
):
...
def
__getattr__
(
self
,
name
):
...
def
__setattr__
(
self
,
name
,
value
):
...
def
getAttr
(
self
,
attrname
):
"""
ROUTINE:
getAttr(attrname)
View remainder of file in raw view
推荐文章
挂过科的打火机
·
pthread 简要使用指南(三) 线程的终止_pthread 判断是否结束-CSDN博客
2 月前
沉稳的紫菜汤
·
Flink broadcast的用法-阿里云开发者社区
2 月前
小胡子的围巾
·
CSS button 按钮大小设置三种方法 | CSS教程
3 月前
沉稳的萝卜
·
JSX:循环与数组渲染 · fuck-react
3 月前
眉毛粗的木瓜
·
2020合肥新站高新区初中学区划分图一览- 合肥本地宝
5 月前