本文整理汇总了Python中solver.Solver.find_next_solution方法的典型用法代码示例。如果您正苦于以下问题:Python Solver.find_next_solution方法的具体用法?Python Solver.find_next_solution怎么用?Python Solver.find_next_solution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solver.Solver
的用法示例。
在下文中一共展示了Solver.find_next_solution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: solve
# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import find_next_solution [as 别名]
def solve(sl: solver.Solver):
"""These will run on separate thread"""
global solution
s = 0
while s != -1:
s = sl.find_next_solution()
if s != -1:
print('Solution#', s)
solution = sl.get_grid()
print('end')
示例2: len
# 需要导入模块: from solver import Solver [as 别名]
# 或者: from solver.Solver import find_next_solution [as 别名]
import nonograms.loader as jx_loader
from solver import Solver
file_name = 'nonograms/test_set/winter.jx' # default
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
file_name = sys.argv[1]
conditions = jx_loader.load_nonogram(file_name)
sl = Solver(conditions)
if -1 == sl.find_next_solution():
print('Invalid conditions')
else:
print(sl)