Chọn trạng thái mô hình
Dựa vào đoạn mã dưới đây, hãy chọn trạng thái mô hình sẽ được in ra.
# Initialize Class, Define Decision Vars., Objective Function, and Constraints
from pulp import *
model = LpProblem("Exercise Routine", LpMaximize)
P = LpVariable('Pushups', lowBound=0)
R = LpVariable('Miles ran', lowBound=0)
model += 3 * P + 10 * R
model += P + R < 10
model += R > 11
# Solve Model
model.solve()
print("Status:", LpStatus[model.status])
Bài tập này là một phần của khóa học
Phân tích Chuỗi Cung Ứng với Python
Bài tập tương tác thực hành
Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi
Bắt đầu bài tập