热门

最新

红包

立Flag

投票

同城

我的

发布
lingduxingxi
lingduxingxi
3 年前
truelingduxingxi

#astromana天文酷图# #天文酷图#
【astromana天文酷图】

【信息来源日期:2019年07月21日】
1969年7月20日,巴兹·奥尔德林和尼尔·阿姆斯特朗在月球上。拍摄自登月舱上的相机。
来源:tumblr
出处:astromana
翻译:baidu*

*:此为机器翻译且未人工审核,可能有不通顺的地方。
发布时间:2023年02月19日19时50分29秒

元宇宙交流区
CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
#ortools 解线性规划from ortools.sat.python import cp_modelmodel = cp_model.CpModel()# 定义变量x1 = model.NewIntVar(0, 1000, "x1")x2 = model.NewIntVar(0, 1000, "x2")x3 = model.NewIntVar(0, 1000, "x3")x4 = model.NewIntVar(0, 1000, "x4")x5 = model.NewIntVar(0, 1000, "x5")x6 = model.NewIntVar(0, 1000, "x6")x7 = model.NewIntVar(0, 1000, "x7")x8 = model.NewIntVar(0, 1000, "x8")# 添加约束model.Add(2 * x1 + x2 + x3 + x4 >= 100)model.Add(2 * x2 + x3 + 3 * x5 + 2 * x6 + x7 >= 150)model.Add(x1 + x3 + 3 * x4 + 2 * x6 + 3 * x7 + 5 * x8 >= 100)# 添加目标函数model.Minimize(5 * x1 + 6 * x2 + 23 * x3 + 5 * x4 + 24 * x5 + 6 * x6 + 23 * x7 + 5 * x8)# 求解solver = cp_model.CpSolver()solver.Solve(model)print("目标函数值是:", solver.ObjectiveValue())print("x1值是:", solver.Value(x1))
立即登录