質問編集履歴
1
プログラムの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -153,9 +153,9 @@
|
|
153
153
|
problem += 7*x_e + 5* x_r <= 360
|
154
154
|
|
155
155
|
###新たに加えた制約
|
156
|
-
if x_r.value >= 1:
|
156
|
+
if x_r.value() >= 1:
|
157
|
-
|
157
|
+
y_r=1
|
158
|
-
|
158
|
+
problem += y_r == 1
|
159
159
|
|
160
160
|
# 最適化
|
161
161
|
problem.solve()
|
@@ -170,8 +170,8 @@
|
|
170
170
|
|
171
171
|
```Result1
|
172
172
|
~省略~
|
173
|
-
|
173
|
+
if x_r.value() >= 1:
|
174
|
-
TypeError: '>=' not supported between instances of '
|
174
|
+
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
|
175
175
|
```
|
176
176
|
|
177
177
|
|