本文整理汇总了Python中problem.Problem.solution方法的典型用法代码示例。如果您正苦于以下问题:Python Problem.solution方法的具体用法?Python Problem.solution怎么用?Python Problem.solution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类problem.Problem
的用法示例。
在下文中一共展示了Problem.solution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import solution [as 别名]
def test():
problem = Problem(
id='6nXC7iyndcldO1dvKHbBmDHv',
size=6, operators=frozenset(['not', 'shr4', 'shr16', 'shr1']))
problem.solution = '(lambda (x_5171) (shr4 (shr16 (shr1 (not x_5171)))))'
server = Server([problem])
solve(problem, server)
示例2: Problem
# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import solution [as 别名]
from pprint import pprint
from collections import namedtuple, Counter
import pickle, json, os, re
from os import path as os_path
from communicate import send, get_training_problem
from terms import parse_term
from problem import Problem
import local_server
# adjust log levels
import logging
logging.getLogger('unique_db').setLevel(logging.WARNING)
logging.getLogger('stats').setLevel(logging.WARNING)
log.info('Yo!')
import solver_driver
import brute_force_solver
from communicate import get_training_problem_iter
p = Problem('123', 10, ['not', 'xor', 'shr4', 'tfold'])
p.solution = '(lambda (x_6821) (fold x_6821 0 (lambda (x_6821 x_6822) (shr4 (xor (not x_6822) x_6821)))))'
server = local_server.Server([p])
solver = brute_force_solver.Solver()
solver_driver.train(server, solver)
log.info('done')