[ModelBuilder] Polish numpy code

This commit is contained in:
Laurent Perron
2023-02-28 22:47:12 +04:00
parent f496dcbb17
commit ed006ad70b
2 changed files with 58 additions and 66 deletions

View File

@@ -67,7 +67,7 @@ def main():
# The amount packed in each bin cannot exceed its capacity.
for j in data['bins']:
model.add(
np.dot(x[:, j], data['weights']) <= y[j] * data['bin_capacity'])
np.dot(x[:, j], data['weights']) <= data['bin_capacity'] * y[j])
# [END constraints]
# [START objective]