当前位置: 首页>>代码示例>>Python>>正文


Python Problem.solution方法代码示例

本文整理汇总了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)
开发者ID:Vlad-Shcherbina,项目名称:icfpc2013-follow-up,代码行数:11,代码来源:solver_test.py

示例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')
开发者ID:Vlad-Shcherbina,项目名称:icfpc2013-tbd,代码行数:32,代码来源:test.py


注:本文中的problem.Problem.solution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。