如何检查Python中的定义约束?
有什么方法可以检查模型并查看已定义了哪些约束?
例如, /or-tools/blob/stable/examples/python/sudoku_sat.py 定义以下内容:
# AllDifferent on rows.
for i in line:
model.AddAllDifferent(grid[(i, j)] for j in line)
这是否在 model 中创建一些可观察的实体(例如,实体构成的数量)?
Is there any way to inspect model and see what constraints have been defined?
For instance, https://github.com/google/or-tools/blob/stable/examples/python/sudoku_sat.py defines the following:
# AllDifferent on rows.
for i in line:
model.AddAllDifferent(grid[(i, j)] for j in line)
Does this create some observable entity in model (e.g. i number of entity-constraints)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以扫描基础CP_MODEL PROTOBUF。
请参阅model.proto()
You can scan the underlying cp_model protobuf.
see model.Proto()